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 BulkPermissionCheckRequest with the |
728
|
|
|
// rules 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 *BulkPermissionCheckRequest) Validate() error { |
731
|
|
|
return m.validate(false) |
732
|
|
|
} |
733
|
|
|
|
734
|
|
|
// ValidateAll checks the field values on BulkPermissionCheckRequest 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
|
|
|
// BulkPermissionCheckRequestMultiError, or nil if none found. |
738
|
|
|
func (m *BulkPermissionCheckRequest) ValidateAll() error { |
739
|
|
|
return m.validate(true) |
740
|
|
|
} |
741
|
|
|
|
742
|
|
|
func (m *BulkPermissionCheckRequest) 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 := BulkPermissionCheckRequestValidationError{ |
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 !_BulkPermissionCheckRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
761
|
|
|
err := BulkPermissionCheckRequestValidationError{ |
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 len(m.GetChecks()) > 100 { |
772
|
|
|
err := BulkPermissionCheckRequestValidationError{ |
773
|
|
|
field: "Checks", |
774
|
|
|
reason: "value must contain no more than 100 item(s)", |
775
|
|
|
} |
776
|
|
|
if !all { |
777
|
|
|
return err |
778
|
|
|
} |
779
|
|
|
errors = append(errors, err) |
780
|
|
|
} |
781
|
|
|
|
782
|
|
|
for idx, item := range m.GetChecks() { |
783
|
|
|
_, _ = idx, item |
784
|
|
|
|
785
|
|
|
if item == nil { |
786
|
|
|
err := BulkPermissionCheckRequestValidationError{ |
787
|
|
|
field: fmt.Sprintf("Checks[%v]", idx), |
788
|
|
|
reason: "value is required", |
789
|
|
|
} |
790
|
|
|
if !all { |
791
|
|
|
return err |
792
|
|
|
} |
793
|
|
|
errors = append(errors, err) |
794
|
|
|
} |
795
|
|
|
|
796
|
|
|
if all { |
797
|
|
|
switch v := interface{}(item).(type) { |
798
|
|
|
case interface{ ValidateAll() error }: |
799
|
|
|
if err := v.ValidateAll(); err != nil { |
800
|
|
|
errors = append(errors, BulkPermissionCheckRequestValidationError{ |
801
|
|
|
field: fmt.Sprintf("Checks[%v]", idx), |
802
|
|
|
reason: "embedded message failed validation", |
803
|
|
|
cause: err, |
804
|
|
|
}) |
805
|
|
|
} |
806
|
|
|
case interface{ Validate() error }: |
807
|
|
|
if err := v.Validate(); err != nil { |
808
|
|
|
errors = append(errors, BulkPermissionCheckRequestValidationError{ |
809
|
|
|
field: fmt.Sprintf("Checks[%v]", idx), |
810
|
|
|
reason: "embedded message failed validation", |
811
|
|
|
cause: err, |
812
|
|
|
}) |
813
|
|
|
} |
814
|
|
|
} |
815
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
816
|
|
|
if err := v.Validate(); err != nil { |
817
|
|
|
return BulkPermissionCheckRequestValidationError{ |
818
|
|
|
field: fmt.Sprintf("Checks[%v]", idx), |
819
|
|
|
reason: "embedded message failed validation", |
820
|
|
|
cause: err, |
821
|
|
|
} |
822
|
|
|
} |
823
|
|
|
} |
824
|
|
|
|
825
|
|
|
} |
826
|
|
|
|
827
|
|
|
if len(errors) > 0 { |
828
|
|
|
return BulkPermissionCheckRequestMultiError(errors) |
829
|
|
|
} |
830
|
|
|
|
831
|
|
|
return nil |
832
|
|
|
} |
833
|
|
|
|
834
|
|
|
// BulkPermissionCheckRequestMultiError is an error wrapping multiple |
835
|
|
|
// validation errors returned by BulkPermissionCheckRequest.ValidateAll() if |
836
|
|
|
// the designated constraints aren't met. |
837
|
|
|
type BulkPermissionCheckRequestMultiError []error |
838
|
|
|
|
839
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
840
|
|
|
func (m BulkPermissionCheckRequestMultiError) Error() string { |
841
|
|
|
var msgs []string |
842
|
|
|
for _, err := range m { |
843
|
|
|
msgs = append(msgs, err.Error()) |
844
|
|
|
} |
845
|
|
|
return strings.Join(msgs, "; ") |
846
|
|
|
} |
847
|
|
|
|
848
|
|
|
// AllErrors returns a list of validation violation errors. |
849
|
|
|
func (m BulkPermissionCheckRequestMultiError) AllErrors() []error { return m } |
850
|
|
|
|
851
|
|
|
// BulkPermissionCheckRequestValidationError is the validation error returned |
852
|
|
|
// by BulkPermissionCheckRequest.Validate if the designated constraints aren't met. |
853
|
|
|
type BulkPermissionCheckRequestValidationError struct { |
854
|
|
|
field string |
855
|
|
|
reason string |
856
|
|
|
cause error |
857
|
|
|
key bool |
858
|
|
|
} |
859
|
|
|
|
860
|
|
|
// Field function returns field value. |
861
|
|
|
func (e BulkPermissionCheckRequestValidationError) Field() string { return e.field } |
862
|
|
|
|
863
|
|
|
// Reason function returns reason value. |
864
|
|
|
func (e BulkPermissionCheckRequestValidationError) Reason() string { return e.reason } |
865
|
|
|
|
866
|
|
|
// Cause function returns cause value. |
867
|
|
|
func (e BulkPermissionCheckRequestValidationError) Cause() error { return e.cause } |
868
|
|
|
|
869
|
|
|
// Key function returns key value. |
870
|
|
|
func (e BulkPermissionCheckRequestValidationError) Key() bool { return e.key } |
871
|
|
|
|
872
|
|
|
// ErrorName returns error name. |
873
|
|
|
func (e BulkPermissionCheckRequestValidationError) ErrorName() string { |
874
|
|
|
return "BulkPermissionCheckRequestValidationError" |
875
|
|
|
} |
876
|
|
|
|
877
|
|
|
// Error satisfies the builtin error interface |
878
|
|
|
func (e BulkPermissionCheckRequestValidationError) Error() string { |
879
|
|
|
cause := "" |
880
|
|
|
if e.cause != nil { |
881
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
882
|
|
|
} |
883
|
|
|
|
884
|
|
|
key := "" |
885
|
|
|
if e.key { |
886
|
|
|
key = "key for " |
887
|
|
|
} |
888
|
|
|
|
889
|
|
|
return fmt.Sprintf( |
890
|
|
|
"invalid %sBulkPermissionCheckRequest.%s: %s%s", |
891
|
|
|
key, |
892
|
|
|
e.field, |
893
|
|
|
e.reason, |
894
|
|
|
cause) |
895
|
|
|
} |
896
|
|
|
|
897
|
|
|
var _ error = BulkPermissionCheckRequestValidationError{} |
898
|
|
|
|
899
|
|
|
var _ interface { |
900
|
|
|
Field() string |
901
|
|
|
Reason() string |
902
|
|
|
Key() bool |
903
|
|
|
Cause() error |
904
|
|
|
ErrorName() string |
905
|
|
|
} = BulkPermissionCheckRequestValidationError{} |
906
|
|
|
|
907
|
|
|
var _BulkPermissionCheckRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
908
|
|
|
|
909
|
|
|
// Validate checks the field values on SinglePermissionCheck with the rules |
910
|
|
|
// defined in the proto definition for this message. If any rules are |
911
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
912
|
|
|
func (m *SinglePermissionCheck) Validate() error { |
913
|
|
|
return m.validate(false) |
914
|
|
|
} |
915
|
|
|
|
916
|
|
|
// ValidateAll checks the field values on SinglePermissionCheck with the rules |
917
|
|
|
// defined in the proto definition for this message. If any rules are |
918
|
|
|
// violated, the result is a list of violation errors wrapped in |
919
|
|
|
// SinglePermissionCheckMultiError, or nil if none found. |
920
|
|
|
func (m *SinglePermissionCheck) ValidateAll() error { |
921
|
|
|
return m.validate(true) |
922
|
|
|
} |
923
|
|
|
|
924
|
|
|
func (m *SinglePermissionCheck) validate(all bool) error { |
925
|
|
|
if m == nil { |
926
|
|
|
return nil |
927
|
|
|
} |
928
|
|
|
|
929
|
|
|
var errors []error |
930
|
|
|
|
931
|
|
|
if m.GetIndex() < 0 { |
932
|
|
|
err := SinglePermissionCheckValidationError{ |
933
|
|
|
field: "Index", |
934
|
|
|
reason: "value must be greater than or equal to 0", |
935
|
|
|
} |
936
|
|
|
if !all { |
937
|
|
|
return err |
938
|
|
|
} |
939
|
|
|
errors = append(errors, err) |
940
|
|
|
} |
941
|
|
|
|
942
|
|
|
if m.GetMetadata() == nil { |
943
|
|
|
err := SinglePermissionCheckValidationError{ |
944
|
|
|
field: "Metadata", |
945
|
|
|
reason: "value is required", |
946
|
|
|
} |
947
|
|
|
if !all { |
948
|
|
|
return err |
949
|
|
|
} |
950
|
|
|
errors = append(errors, err) |
951
|
|
|
} |
952
|
|
|
|
953
|
|
|
if all { |
954
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
955
|
|
|
case interface{ ValidateAll() error }: |
956
|
|
|
if err := v.ValidateAll(); err != nil { |
957
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
958
|
|
|
field: "Metadata", |
959
|
|
|
reason: "embedded message failed validation", |
960
|
|
|
cause: err, |
961
|
|
|
}) |
962
|
|
|
} |
963
|
|
|
case interface{ Validate() error }: |
964
|
|
|
if err := v.Validate(); err != nil { |
965
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
966
|
|
|
field: "Metadata", |
967
|
|
|
reason: "embedded message failed validation", |
968
|
|
|
cause: err, |
969
|
|
|
}) |
970
|
|
|
} |
971
|
|
|
} |
972
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
973
|
|
|
if err := v.Validate(); err != nil { |
974
|
|
|
return SinglePermissionCheckValidationError{ |
975
|
|
|
field: "Metadata", |
976
|
|
|
reason: "embedded message failed validation", |
977
|
|
|
cause: err, |
978
|
|
|
} |
979
|
|
|
} |
980
|
|
|
} |
981
|
|
|
|
982
|
|
|
if m.GetEntity() == nil { |
983
|
|
|
err := SinglePermissionCheckValidationError{ |
984
|
|
|
field: "Entity", |
985
|
|
|
reason: "value is required", |
986
|
|
|
} |
987
|
|
|
if !all { |
988
|
|
|
return err |
989
|
|
|
} |
990
|
|
|
errors = append(errors, err) |
991
|
|
|
} |
992
|
|
|
|
993
|
|
|
if all { |
994
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
995
|
|
|
case interface{ ValidateAll() error }: |
996
|
|
|
if err := v.ValidateAll(); err != nil { |
997
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
998
|
|
|
field: "Entity", |
999
|
|
|
reason: "embedded message failed validation", |
1000
|
|
|
cause: err, |
1001
|
|
|
}) |
1002
|
|
|
} |
1003
|
|
|
case interface{ Validate() error }: |
1004
|
|
|
if err := v.Validate(); err != nil { |
1005
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1006
|
|
|
field: "Entity", |
1007
|
|
|
reason: "embedded message failed validation", |
1008
|
|
|
cause: err, |
1009
|
|
|
}) |
1010
|
|
|
} |
1011
|
|
|
} |
1012
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
1013
|
|
|
if err := v.Validate(); err != nil { |
1014
|
|
|
return SinglePermissionCheckValidationError{ |
1015
|
|
|
field: "Entity", |
1016
|
|
|
reason: "embedded message failed validation", |
1017
|
|
|
cause: err, |
1018
|
|
|
} |
1019
|
|
|
} |
1020
|
|
|
} |
1021
|
|
|
|
1022
|
|
|
if len(m.GetPermission()) > 64 { |
1023
|
|
|
err := SinglePermissionCheckValidationError{ |
1024
|
|
|
field: "Permission", |
1025
|
|
|
reason: "value length must be at most 64 bytes", |
1026
|
|
|
} |
1027
|
|
|
if !all { |
1028
|
|
|
return err |
1029
|
|
|
} |
1030
|
|
|
errors = append(errors, err) |
1031
|
|
|
} |
1032
|
|
|
|
1033
|
|
|
if !_SinglePermissionCheck_Permission_Pattern.MatchString(m.GetPermission()) { |
1034
|
|
|
err := SinglePermissionCheckValidationError{ |
1035
|
|
|
field: "Permission", |
1036
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1037
|
|
|
} |
1038
|
|
|
if !all { |
1039
|
|
|
return err |
1040
|
|
|
} |
1041
|
|
|
errors = append(errors, err) |
1042
|
|
|
} |
1043
|
|
|
|
1044
|
|
|
if m.GetSubject() == nil { |
1045
|
|
|
err := SinglePermissionCheckValidationError{ |
1046
|
|
|
field: "Subject", |
1047
|
|
|
reason: "value is required", |
1048
|
|
|
} |
1049
|
|
|
if !all { |
1050
|
|
|
return err |
1051
|
|
|
} |
1052
|
|
|
errors = append(errors, err) |
1053
|
|
|
} |
1054
|
|
|
|
1055
|
|
|
if all { |
1056
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
1057
|
|
|
case interface{ ValidateAll() error }: |
1058
|
|
|
if err := v.ValidateAll(); err != nil { |
1059
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1060
|
|
|
field: "Subject", |
1061
|
|
|
reason: "embedded message failed validation", |
1062
|
|
|
cause: err, |
1063
|
|
|
}) |
1064
|
|
|
} |
1065
|
|
|
case interface{ Validate() error }: |
1066
|
|
|
if err := v.Validate(); err != nil { |
1067
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1068
|
|
|
field: "Subject", |
1069
|
|
|
reason: "embedded message failed validation", |
1070
|
|
|
cause: err, |
1071
|
|
|
}) |
1072
|
|
|
} |
1073
|
|
|
} |
1074
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
1075
|
|
|
if err := v.Validate(); err != nil { |
1076
|
|
|
return SinglePermissionCheckValidationError{ |
1077
|
|
|
field: "Subject", |
1078
|
|
|
reason: "embedded message failed validation", |
1079
|
|
|
cause: err, |
1080
|
|
|
} |
1081
|
|
|
} |
1082
|
|
|
} |
1083
|
|
|
|
1084
|
|
|
if all { |
1085
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
1086
|
|
|
case interface{ ValidateAll() error }: |
1087
|
|
|
if err := v.ValidateAll(); err != nil { |
1088
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1089
|
|
|
field: "Context", |
1090
|
|
|
reason: "embedded message failed validation", |
1091
|
|
|
cause: err, |
1092
|
|
|
}) |
1093
|
|
|
} |
1094
|
|
|
case interface{ Validate() error }: |
1095
|
|
|
if err := v.Validate(); err != nil { |
1096
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1097
|
|
|
field: "Context", |
1098
|
|
|
reason: "embedded message failed validation", |
1099
|
|
|
cause: err, |
1100
|
|
|
}) |
1101
|
|
|
} |
1102
|
|
|
} |
1103
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
1104
|
|
|
if err := v.Validate(); err != nil { |
1105
|
|
|
return SinglePermissionCheckValidationError{ |
1106
|
|
|
field: "Context", |
1107
|
|
|
reason: "embedded message failed validation", |
1108
|
|
|
cause: err, |
1109
|
|
|
} |
1110
|
|
|
} |
1111
|
|
|
} |
1112
|
|
|
|
1113
|
|
|
for idx, item := range m.GetArguments() { |
1114
|
|
|
_, _ = idx, item |
1115
|
|
|
|
1116
|
|
|
if all { |
1117
|
|
|
switch v := interface{}(item).(type) { |
1118
|
|
|
case interface{ ValidateAll() error }: |
1119
|
|
|
if err := v.ValidateAll(); err != nil { |
1120
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1121
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
1122
|
|
|
reason: "embedded message failed validation", |
1123
|
|
|
cause: err, |
1124
|
|
|
}) |
1125
|
|
|
} |
1126
|
|
|
case interface{ Validate() error }: |
1127
|
|
|
if err := v.Validate(); err != nil { |
1128
|
|
|
errors = append(errors, SinglePermissionCheckValidationError{ |
1129
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
1130
|
|
|
reason: "embedded message failed validation", |
1131
|
|
|
cause: err, |
1132
|
|
|
}) |
1133
|
|
|
} |
1134
|
|
|
} |
1135
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
1136
|
|
|
if err := v.Validate(); err != nil { |
1137
|
|
|
return SinglePermissionCheckValidationError{ |
1138
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
1139
|
|
|
reason: "embedded message failed validation", |
1140
|
|
|
cause: err, |
1141
|
|
|
} |
1142
|
|
|
} |
1143
|
|
|
} |
1144
|
|
|
|
1145
|
|
|
} |
1146
|
|
|
|
1147
|
|
|
if len(errors) > 0 { |
1148
|
|
|
return SinglePermissionCheckMultiError(errors) |
1149
|
|
|
} |
1150
|
|
|
|
1151
|
|
|
return nil |
1152
|
|
|
} |
1153
|
|
|
|
1154
|
|
|
// SinglePermissionCheckMultiError is an error wrapping multiple validation |
1155
|
|
|
// errors returned by SinglePermissionCheck.ValidateAll() if the designated |
1156
|
|
|
// constraints aren't met. |
1157
|
|
|
type SinglePermissionCheckMultiError []error |
1158
|
|
|
|
1159
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1160
|
|
|
func (m SinglePermissionCheckMultiError) Error() string { |
1161
|
|
|
var msgs []string |
1162
|
|
|
for _, err := range m { |
1163
|
|
|
msgs = append(msgs, err.Error()) |
1164
|
|
|
} |
1165
|
|
|
return strings.Join(msgs, "; ") |
1166
|
|
|
} |
1167
|
|
|
|
1168
|
|
|
// AllErrors returns a list of validation violation errors. |
1169
|
|
|
func (m SinglePermissionCheckMultiError) AllErrors() []error { return m } |
1170
|
|
|
|
1171
|
|
|
// SinglePermissionCheckValidationError is the validation error returned by |
1172
|
|
|
// SinglePermissionCheck.Validate if the designated constraints aren't met. |
1173
|
|
|
type SinglePermissionCheckValidationError struct { |
1174
|
|
|
field string |
1175
|
|
|
reason string |
1176
|
|
|
cause error |
1177
|
|
|
key bool |
1178
|
|
|
} |
1179
|
|
|
|
1180
|
|
|
// Field function returns field value. |
1181
|
|
|
func (e SinglePermissionCheckValidationError) Field() string { return e.field } |
1182
|
|
|
|
1183
|
|
|
// Reason function returns reason value. |
1184
|
|
|
func (e SinglePermissionCheckValidationError) Reason() string { return e.reason } |
1185
|
|
|
|
1186
|
|
|
// Cause function returns cause value. |
1187
|
|
|
func (e SinglePermissionCheckValidationError) Cause() error { return e.cause } |
1188
|
|
|
|
1189
|
|
|
// Key function returns key value. |
1190
|
|
|
func (e SinglePermissionCheckValidationError) Key() bool { return e.key } |
1191
|
|
|
|
1192
|
|
|
// ErrorName returns error name. |
1193
|
|
|
func (e SinglePermissionCheckValidationError) ErrorName() string { |
1194
|
|
|
return "SinglePermissionCheckValidationError" |
1195
|
|
|
} |
1196
|
|
|
|
1197
|
|
|
// Error satisfies the builtin error interface |
1198
|
|
|
func (e SinglePermissionCheckValidationError) Error() string { |
1199
|
|
|
cause := "" |
1200
|
|
|
if e.cause != nil { |
1201
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1202
|
|
|
} |
1203
|
|
|
|
1204
|
|
|
key := "" |
1205
|
|
|
if e.key { |
1206
|
|
|
key = "key for " |
1207
|
|
|
} |
1208
|
|
|
|
1209
|
|
|
return fmt.Sprintf( |
1210
|
|
|
"invalid %sSinglePermissionCheck.%s: %s%s", |
1211
|
|
|
key, |
1212
|
|
|
e.field, |
1213
|
|
|
e.reason, |
1214
|
|
|
cause) |
1215
|
|
|
} |
1216
|
|
|
|
1217
|
|
|
var _ error = SinglePermissionCheckValidationError{} |
1218
|
|
|
|
1219
|
|
|
var _ interface { |
1220
|
|
|
Field() string |
1221
|
|
|
Reason() string |
1222
|
|
|
Key() bool |
1223
|
|
|
Cause() error |
1224
|
|
|
ErrorName() string |
1225
|
|
|
} = SinglePermissionCheckValidationError{} |
1226
|
|
|
|
1227
|
|
|
var _SinglePermissionCheck_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1228
|
|
|
|
1229
|
|
|
// Validate checks the field values on BulkPermissionCheckResponse with the |
1230
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1231
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1232
|
|
|
func (m *BulkPermissionCheckResponse) Validate() error { |
1233
|
|
|
return m.validate(false) |
1234
|
|
|
} |
1235
|
|
|
|
1236
|
|
|
// ValidateAll checks the field values on BulkPermissionCheckResponse with the |
1237
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1238
|
|
|
// violated, the result is a list of violation errors wrapped in |
1239
|
|
|
// BulkPermissionCheckResponseMultiError, or nil if none found. |
1240
|
|
|
func (m *BulkPermissionCheckResponse) ValidateAll() error { |
1241
|
|
|
return m.validate(true) |
1242
|
|
|
} |
1243
|
|
|
|
1244
|
|
|
func (m *BulkPermissionCheckResponse) validate(all bool) error { |
1245
|
|
|
if m == nil { |
1246
|
|
|
return nil |
1247
|
|
|
} |
1248
|
|
|
|
1249
|
|
|
var errors []error |
1250
|
|
|
|
1251
|
|
|
if len(m.GetResults()) > 100 { |
1252
|
|
|
err := BulkPermissionCheckResponseValidationError{ |
1253
|
|
|
field: "Results", |
1254
|
|
|
reason: "value must contain no more than 100 item(s)", |
1255
|
|
|
} |
1256
|
|
|
if !all { |
1257
|
|
|
return err |
1258
|
|
|
} |
1259
|
|
|
errors = append(errors, err) |
1260
|
|
|
} |
1261
|
|
|
|
1262
|
|
|
for idx, item := range m.GetResults() { |
1263
|
|
|
_, _ = idx, item |
1264
|
|
|
|
1265
|
|
|
if item == nil { |
1266
|
|
|
err := BulkPermissionCheckResponseValidationError{ |
1267
|
|
|
field: fmt.Sprintf("Results[%v]", idx), |
1268
|
|
|
reason: "value is required", |
1269
|
|
|
} |
1270
|
|
|
if !all { |
1271
|
|
|
return err |
1272
|
|
|
} |
1273
|
|
|
errors = append(errors, err) |
1274
|
|
|
} |
1275
|
|
|
|
1276
|
|
|
if all { |
1277
|
|
|
switch v := interface{}(item).(type) { |
1278
|
|
|
case interface{ ValidateAll() error }: |
1279
|
|
|
if err := v.ValidateAll(); err != nil { |
1280
|
|
|
errors = append(errors, BulkPermissionCheckResponseValidationError{ |
1281
|
|
|
field: fmt.Sprintf("Results[%v]", idx), |
1282
|
|
|
reason: "embedded message failed validation", |
1283
|
|
|
cause: err, |
1284
|
|
|
}) |
1285
|
|
|
} |
1286
|
|
|
case interface{ Validate() error }: |
1287
|
|
|
if err := v.Validate(); err != nil { |
1288
|
|
|
errors = append(errors, BulkPermissionCheckResponseValidationError{ |
1289
|
|
|
field: fmt.Sprintf("Results[%v]", idx), |
1290
|
|
|
reason: "embedded message failed validation", |
1291
|
|
|
cause: err, |
1292
|
|
|
}) |
1293
|
|
|
} |
1294
|
|
|
} |
1295
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
1296
|
|
|
if err := v.Validate(); err != nil { |
1297
|
|
|
return BulkPermissionCheckResponseValidationError{ |
1298
|
|
|
field: fmt.Sprintf("Results[%v]", idx), |
1299
|
|
|
reason: "embedded message failed validation", |
1300
|
|
|
cause: err, |
1301
|
|
|
} |
1302
|
|
|
} |
1303
|
|
|
} |
1304
|
|
|
|
1305
|
|
|
} |
1306
|
|
|
|
1307
|
|
|
if len(errors) > 0 { |
1308
|
|
|
return BulkPermissionCheckResponseMultiError(errors) |
1309
|
|
|
} |
1310
|
|
|
|
1311
|
|
|
return nil |
1312
|
|
|
} |
1313
|
|
|
|
1314
|
|
|
// BulkPermissionCheckResponseMultiError is an error wrapping multiple |
1315
|
|
|
// validation errors returned by BulkPermissionCheckResponse.ValidateAll() if |
1316
|
|
|
// the designated constraints aren't met. |
1317
|
|
|
type BulkPermissionCheckResponseMultiError []error |
1318
|
|
|
|
1319
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1320
|
|
|
func (m BulkPermissionCheckResponseMultiError) Error() string { |
1321
|
|
|
var msgs []string |
1322
|
|
|
for _, err := range m { |
1323
|
|
|
msgs = append(msgs, err.Error()) |
1324
|
|
|
} |
1325
|
|
|
return strings.Join(msgs, "; ") |
1326
|
|
|
} |
1327
|
|
|
|
1328
|
|
|
// AllErrors returns a list of validation violation errors. |
1329
|
|
|
func (m BulkPermissionCheckResponseMultiError) AllErrors() []error { return m } |
1330
|
|
|
|
1331
|
|
|
// BulkPermissionCheckResponseValidationError is the validation error returned |
1332
|
|
|
// by BulkPermissionCheckResponse.Validate if the designated constraints |
1333
|
|
|
// aren't met. |
1334
|
|
|
type BulkPermissionCheckResponseValidationError struct { |
1335
|
|
|
field string |
1336
|
|
|
reason string |
1337
|
|
|
cause error |
1338
|
|
|
key bool |
1339
|
|
|
} |
1340
|
|
|
|
1341
|
|
|
// Field function returns field value. |
1342
|
|
|
func (e BulkPermissionCheckResponseValidationError) Field() string { return e.field } |
1343
|
|
|
|
1344
|
|
|
// Reason function returns reason value. |
1345
|
|
|
func (e BulkPermissionCheckResponseValidationError) Reason() string { return e.reason } |
1346
|
|
|
|
1347
|
|
|
// Cause function returns cause value. |
1348
|
|
|
func (e BulkPermissionCheckResponseValidationError) Cause() error { return e.cause } |
1349
|
|
|
|
1350
|
|
|
// Key function returns key value. |
1351
|
|
|
func (e BulkPermissionCheckResponseValidationError) Key() bool { return e.key } |
1352
|
|
|
|
1353
|
|
|
// ErrorName returns error name. |
1354
|
|
|
func (e BulkPermissionCheckResponseValidationError) ErrorName() string { |
1355
|
|
|
return "BulkPermissionCheckResponseValidationError" |
1356
|
|
|
} |
1357
|
|
|
|
1358
|
|
|
// Error satisfies the builtin error interface |
1359
|
|
|
func (e BulkPermissionCheckResponseValidationError) Error() string { |
1360
|
|
|
cause := "" |
1361
|
|
|
if e.cause != nil { |
1362
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1363
|
|
|
} |
1364
|
|
|
|
1365
|
|
|
key := "" |
1366
|
|
|
if e.key { |
1367
|
|
|
key = "key for " |
1368
|
|
|
} |
1369
|
|
|
|
1370
|
|
|
return fmt.Sprintf( |
1371
|
|
|
"invalid %sBulkPermissionCheckResponse.%s: %s%s", |
1372
|
|
|
key, |
1373
|
|
|
e.field, |
1374
|
|
|
e.reason, |
1375
|
|
|
cause) |
1376
|
|
|
} |
1377
|
|
|
|
1378
|
|
|
var _ error = BulkPermissionCheckResponseValidationError{} |
1379
|
|
|
|
1380
|
|
|
var _ interface { |
1381
|
|
|
Field() string |
1382
|
|
|
Reason() string |
1383
|
|
|
Key() bool |
1384
|
|
|
Cause() error |
1385
|
|
|
ErrorName() string |
1386
|
|
|
} = BulkPermissionCheckResponseValidationError{} |
1387
|
|
|
|
1388
|
|
|
// Validate checks the field values on SinglePermissionCheckResponse with the |
1389
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1390
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1391
|
|
|
func (m *SinglePermissionCheckResponse) Validate() error { |
1392
|
|
|
return m.validate(false) |
1393
|
|
|
} |
1394
|
|
|
|
1395
|
|
|
// ValidateAll checks the field values on SinglePermissionCheckResponse with |
1396
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1397
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1398
|
|
|
// SinglePermissionCheckResponseMultiError, or nil if none found. |
1399
|
|
|
func (m *SinglePermissionCheckResponse) ValidateAll() error { |
1400
|
|
|
return m.validate(true) |
1401
|
|
|
} |
1402
|
|
|
|
1403
|
|
|
func (m *SinglePermissionCheckResponse) validate(all bool) error { |
1404
|
|
|
if m == nil { |
1405
|
|
|
return nil |
1406
|
|
|
} |
1407
|
|
|
|
1408
|
|
|
var errors []error |
1409
|
|
|
|
1410
|
|
|
if m.GetIndex() < 0 { |
1411
|
|
|
err := SinglePermissionCheckResponseValidationError{ |
1412
|
|
|
field: "Index", |
1413
|
|
|
reason: "value must be greater than or equal to 0", |
1414
|
|
|
} |
1415
|
|
|
if !all { |
1416
|
|
|
return err |
1417
|
|
|
} |
1418
|
|
|
errors = append(errors, err) |
1419
|
|
|
} |
1420
|
|
|
|
1421
|
|
|
// no validation rules for Can |
1422
|
|
|
|
1423
|
|
|
if all { |
1424
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
1425
|
|
|
case interface{ ValidateAll() error }: |
1426
|
|
|
if err := v.ValidateAll(); err != nil { |
1427
|
|
|
errors = append(errors, SinglePermissionCheckResponseValidationError{ |
1428
|
|
|
field: "Metadata", |
1429
|
|
|
reason: "embedded message failed validation", |
1430
|
|
|
cause: err, |
1431
|
|
|
}) |
1432
|
|
|
} |
1433
|
|
|
case interface{ Validate() error }: |
1434
|
|
|
if err := v.Validate(); err != nil { |
1435
|
|
|
errors = append(errors, SinglePermissionCheckResponseValidationError{ |
1436
|
|
|
field: "Metadata", |
1437
|
|
|
reason: "embedded message failed validation", |
1438
|
|
|
cause: err, |
1439
|
|
|
}) |
1440
|
|
|
} |
1441
|
|
|
} |
1442
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
1443
|
|
|
if err := v.Validate(); err != nil { |
1444
|
|
|
return SinglePermissionCheckResponseValidationError{ |
1445
|
|
|
field: "Metadata", |
1446
|
|
|
reason: "embedded message failed validation", |
1447
|
|
|
cause: err, |
1448
|
|
|
} |
1449
|
|
|
} |
1450
|
|
|
} |
1451
|
|
|
|
1452
|
|
|
if len(errors) > 0 { |
1453
|
|
|
return SinglePermissionCheckResponseMultiError(errors) |
1454
|
|
|
} |
1455
|
|
|
|
1456
|
|
|
return nil |
1457
|
|
|
} |
1458
|
|
|
|
1459
|
|
|
// SinglePermissionCheckResponseMultiError is an error wrapping multiple |
1460
|
|
|
// validation errors returned by SinglePermissionCheckResponse.ValidateAll() |
1461
|
|
|
// if the designated constraints aren't met. |
1462
|
|
|
type SinglePermissionCheckResponseMultiError []error |
1463
|
|
|
|
1464
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1465
|
|
|
func (m SinglePermissionCheckResponseMultiError) Error() string { |
1466
|
|
|
var msgs []string |
1467
|
|
|
for _, err := range m { |
1468
|
|
|
msgs = append(msgs, err.Error()) |
1469
|
|
|
} |
1470
|
|
|
return strings.Join(msgs, "; ") |
1471
|
|
|
} |
1472
|
|
|
|
1473
|
|
|
// AllErrors returns a list of validation violation errors. |
1474
|
|
|
func (m SinglePermissionCheckResponseMultiError) AllErrors() []error { return m } |
1475
|
|
|
|
1476
|
|
|
// SinglePermissionCheckResponseValidationError is the validation error |
1477
|
|
|
// returned by SinglePermissionCheckResponse.Validate if the designated |
1478
|
|
|
// constraints aren't met. |
1479
|
|
|
type SinglePermissionCheckResponseValidationError struct { |
1480
|
|
|
field string |
1481
|
|
|
reason string |
1482
|
|
|
cause error |
1483
|
|
|
key bool |
1484
|
|
|
} |
1485
|
|
|
|
1486
|
|
|
// Field function returns field value. |
1487
|
|
|
func (e SinglePermissionCheckResponseValidationError) Field() string { return e.field } |
1488
|
|
|
|
1489
|
|
|
// Reason function returns reason value. |
1490
|
|
|
func (e SinglePermissionCheckResponseValidationError) Reason() string { return e.reason } |
1491
|
|
|
|
1492
|
|
|
// Cause function returns cause value. |
1493
|
|
|
func (e SinglePermissionCheckResponseValidationError) Cause() error { return e.cause } |
1494
|
|
|
|
1495
|
|
|
// Key function returns key value. |
1496
|
|
|
func (e SinglePermissionCheckResponseValidationError) Key() bool { return e.key } |
1497
|
|
|
|
1498
|
|
|
// ErrorName returns error name. |
1499
|
|
|
func (e SinglePermissionCheckResponseValidationError) ErrorName() string { |
1500
|
|
|
return "SinglePermissionCheckResponseValidationError" |
1501
|
|
|
} |
1502
|
|
|
|
1503
|
|
|
// Error satisfies the builtin error interface |
1504
|
|
|
func (e SinglePermissionCheckResponseValidationError) Error() string { |
1505
|
|
|
cause := "" |
1506
|
|
|
if e.cause != nil { |
1507
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1508
|
|
|
} |
1509
|
|
|
|
1510
|
|
|
key := "" |
1511
|
|
|
if e.key { |
1512
|
|
|
key = "key for " |
1513
|
|
|
} |
1514
|
|
|
|
1515
|
|
|
return fmt.Sprintf( |
1516
|
|
|
"invalid %sSinglePermissionCheckResponse.%s: %s%s", |
1517
|
|
|
key, |
1518
|
|
|
e.field, |
1519
|
|
|
e.reason, |
1520
|
|
|
cause) |
1521
|
|
|
} |
1522
|
|
|
|
1523
|
|
|
var _ error = SinglePermissionCheckResponseValidationError{} |
1524
|
|
|
|
1525
|
|
|
var _ interface { |
1526
|
|
|
Field() string |
1527
|
|
|
Reason() string |
1528
|
|
|
Key() bool |
1529
|
|
|
Cause() error |
1530
|
|
|
ErrorName() string |
1531
|
|
|
} = SinglePermissionCheckResponseValidationError{} |
1532
|
|
|
|
1533
|
|
|
// Validate checks the field values on PermissionExpandRequest with the rules |
1534
|
|
|
// defined in the proto definition for this message. If any rules are |
1535
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1536
|
|
|
func (m *PermissionExpandRequest) Validate() error { |
1537
|
|
|
return m.validate(false) |
1538
|
|
|
} |
1539
|
|
|
|
1540
|
|
|
// ValidateAll checks the field values on PermissionExpandRequest with the |
1541
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1542
|
|
|
// violated, the result is a list of violation errors wrapped in |
1543
|
|
|
// PermissionExpandRequestMultiError, or nil if none found. |
1544
|
|
|
func (m *PermissionExpandRequest) ValidateAll() error { |
1545
|
|
|
return m.validate(true) |
1546
|
|
|
} |
1547
|
|
|
|
1548
|
|
|
func (m *PermissionExpandRequest) validate(all bool) error { |
1549
|
|
|
if m == nil { |
1550
|
|
|
return nil |
1551
|
|
|
} |
1552
|
|
|
|
1553
|
|
|
var errors []error |
1554
|
|
|
|
1555
|
|
|
if len(m.GetTenantId()) > 128 { |
1556
|
|
|
err := PermissionExpandRequestValidationError{ |
1557
|
|
|
field: "TenantId", |
1558
|
|
|
reason: "value length must be at most 128 bytes", |
1559
|
|
|
} |
1560
|
|
|
if !all { |
1561
|
|
|
return err |
1562
|
|
|
} |
1563
|
|
|
errors = append(errors, err) |
1564
|
|
|
} |
1565
|
|
|
|
1566
|
|
|
if !_PermissionExpandRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
1567
|
|
|
err := PermissionExpandRequestValidationError{ |
1568
|
|
|
field: "TenantId", |
1569
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
1570
|
|
|
} |
1571
|
|
|
if !all { |
1572
|
|
|
return err |
1573
|
|
|
} |
1574
|
|
|
errors = append(errors, err) |
1575
|
|
|
} |
1576
|
|
|
|
1577
|
|
|
if m.GetMetadata() == nil { |
1578
|
|
|
err := PermissionExpandRequestValidationError{ |
1579
|
|
|
field: "Metadata", |
1580
|
|
|
reason: "value is required", |
1581
|
|
|
} |
1582
|
|
|
if !all { |
1583
|
|
|
return err |
1584
|
|
|
} |
1585
|
|
|
errors = append(errors, err) |
1586
|
|
|
} |
1587
|
|
|
|
1588
|
|
|
if all { |
1589
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
1590
|
|
|
case interface{ ValidateAll() error }: |
1591
|
|
|
if err := v.ValidateAll(); err != nil { |
1592
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1593
|
|
|
field: "Metadata", |
1594
|
|
|
reason: "embedded message failed validation", |
1595
|
|
|
cause: err, |
1596
|
|
|
}) |
1597
|
|
|
} |
1598
|
|
|
case interface{ Validate() error }: |
1599
|
|
|
if err := v.Validate(); err != nil { |
1600
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1601
|
|
|
field: "Metadata", |
1602
|
|
|
reason: "embedded message failed validation", |
1603
|
|
|
cause: err, |
1604
|
|
|
}) |
1605
|
|
|
} |
1606
|
|
|
} |
1607
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
1608
|
|
|
if err := v.Validate(); err != nil { |
1609
|
|
|
return PermissionExpandRequestValidationError{ |
1610
|
|
|
field: "Metadata", |
1611
|
|
|
reason: "embedded message failed validation", |
1612
|
|
|
cause: err, |
1613
|
|
|
} |
1614
|
|
|
} |
1615
|
|
|
} |
1616
|
|
|
|
1617
|
|
|
if m.GetEntity() == nil { |
1618
|
|
|
err := PermissionExpandRequestValidationError{ |
1619
|
|
|
field: "Entity", |
1620
|
|
|
reason: "value is required", |
1621
|
|
|
} |
1622
|
|
|
if !all { |
1623
|
|
|
return err |
1624
|
|
|
} |
1625
|
|
|
errors = append(errors, err) |
1626
|
|
|
} |
1627
|
|
|
|
1628
|
|
|
if all { |
1629
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
1630
|
|
|
case interface{ ValidateAll() error }: |
1631
|
|
|
if err := v.ValidateAll(); err != nil { |
1632
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1633
|
|
|
field: "Entity", |
1634
|
|
|
reason: "embedded message failed validation", |
1635
|
|
|
cause: err, |
1636
|
|
|
}) |
1637
|
|
|
} |
1638
|
|
|
case interface{ Validate() error }: |
1639
|
|
|
if err := v.Validate(); err != nil { |
1640
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1641
|
|
|
field: "Entity", |
1642
|
|
|
reason: "embedded message failed validation", |
1643
|
|
|
cause: err, |
1644
|
|
|
}) |
1645
|
|
|
} |
1646
|
|
|
} |
1647
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
1648
|
|
|
if err := v.Validate(); err != nil { |
1649
|
|
|
return PermissionExpandRequestValidationError{ |
1650
|
|
|
field: "Entity", |
1651
|
|
|
reason: "embedded message failed validation", |
1652
|
|
|
cause: err, |
1653
|
|
|
} |
1654
|
|
|
} |
1655
|
|
|
} |
1656
|
|
|
|
1657
|
|
|
if m.GetPermission() != "" { |
1658
|
|
|
|
1659
|
|
|
if len(m.GetPermission()) > 64 { |
1660
|
|
|
err := PermissionExpandRequestValidationError{ |
1661
|
|
|
field: "Permission", |
1662
|
|
|
reason: "value length must be at most 64 bytes", |
1663
|
|
|
} |
1664
|
|
|
if !all { |
1665
|
|
|
return err |
1666
|
|
|
} |
1667
|
|
|
errors = append(errors, err) |
1668
|
|
|
} |
1669
|
|
|
|
1670
|
|
|
if !_PermissionExpandRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
1671
|
|
|
err := PermissionExpandRequestValidationError{ |
1672
|
|
|
field: "Permission", |
1673
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1674
|
|
|
} |
1675
|
|
|
if !all { |
1676
|
|
|
return err |
1677
|
|
|
} |
1678
|
|
|
errors = append(errors, err) |
1679
|
|
|
} |
1680
|
|
|
|
1681
|
|
|
} |
1682
|
|
|
|
1683
|
|
|
if all { |
1684
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
1685
|
|
|
case interface{ ValidateAll() error }: |
1686
|
|
|
if err := v.ValidateAll(); err != nil { |
1687
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1688
|
|
|
field: "Context", |
1689
|
|
|
reason: "embedded message failed validation", |
1690
|
|
|
cause: err, |
1691
|
|
|
}) |
1692
|
|
|
} |
1693
|
|
|
case interface{ Validate() error }: |
1694
|
|
|
if err := v.Validate(); err != nil { |
1695
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1696
|
|
|
field: "Context", |
1697
|
|
|
reason: "embedded message failed validation", |
1698
|
|
|
cause: err, |
1699
|
|
|
}) |
1700
|
|
|
} |
1701
|
|
|
} |
1702
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
1703
|
|
|
if err := v.Validate(); err != nil { |
1704
|
|
|
return PermissionExpandRequestValidationError{ |
1705
|
|
|
field: "Context", |
1706
|
|
|
reason: "embedded message failed validation", |
1707
|
|
|
cause: err, |
1708
|
|
|
} |
1709
|
|
|
} |
1710
|
|
|
} |
1711
|
|
|
|
1712
|
|
|
for idx, item := range m.GetArguments() { |
1713
|
|
|
_, _ = idx, item |
1714
|
|
|
|
1715
|
|
|
if all { |
1716
|
|
|
switch v := interface{}(item).(type) { |
1717
|
|
|
case interface{ ValidateAll() error }: |
1718
|
|
|
if err := v.ValidateAll(); err != nil { |
1719
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1720
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
1721
|
|
|
reason: "embedded message failed validation", |
1722
|
|
|
cause: err, |
1723
|
|
|
}) |
1724
|
|
|
} |
1725
|
|
|
case interface{ Validate() error }: |
1726
|
|
|
if err := v.Validate(); err != nil { |
1727
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
1728
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
1729
|
|
|
reason: "embedded message failed validation", |
1730
|
|
|
cause: err, |
1731
|
|
|
}) |
1732
|
|
|
} |
1733
|
|
|
} |
1734
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
1735
|
|
|
if err := v.Validate(); err != nil { |
1736
|
|
|
return PermissionExpandRequestValidationError{ |
1737
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
1738
|
|
|
reason: "embedded message failed validation", |
1739
|
|
|
cause: err, |
1740
|
|
|
} |
1741
|
|
|
} |
1742
|
|
|
} |
1743
|
|
|
|
1744
|
|
|
} |
1745
|
|
|
|
1746
|
|
|
if len(errors) > 0 { |
1747
|
|
|
return PermissionExpandRequestMultiError(errors) |
1748
|
|
|
} |
1749
|
|
|
|
1750
|
|
|
return nil |
1751
|
|
|
} |
1752
|
|
|
|
1753
|
|
|
// PermissionExpandRequestMultiError is an error wrapping multiple validation |
1754
|
|
|
// errors returned by PermissionExpandRequest.ValidateAll() if the designated |
1755
|
|
|
// constraints aren't met. |
1756
|
|
|
type PermissionExpandRequestMultiError []error |
1757
|
|
|
|
1758
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1759
|
|
|
func (m PermissionExpandRequestMultiError) Error() string { |
1760
|
|
|
var msgs []string |
1761
|
|
|
for _, err := range m { |
1762
|
|
|
msgs = append(msgs, err.Error()) |
1763
|
|
|
} |
1764
|
|
|
return strings.Join(msgs, "; ") |
1765
|
|
|
} |
1766
|
|
|
|
1767
|
|
|
// AllErrors returns a list of validation violation errors. |
1768
|
|
|
func (m PermissionExpandRequestMultiError) AllErrors() []error { return m } |
1769
|
|
|
|
1770
|
|
|
// PermissionExpandRequestValidationError is the validation error returned by |
1771
|
|
|
// PermissionExpandRequest.Validate if the designated constraints aren't met. |
1772
|
|
|
type PermissionExpandRequestValidationError struct { |
1773
|
|
|
field string |
1774
|
|
|
reason string |
1775
|
|
|
cause error |
1776
|
|
|
key bool |
1777
|
|
|
} |
1778
|
|
|
|
1779
|
|
|
// Field function returns field value. |
1780
|
|
|
func (e PermissionExpandRequestValidationError) Field() string { return e.field } |
1781
|
|
|
|
1782
|
|
|
// Reason function returns reason value. |
1783
|
|
|
func (e PermissionExpandRequestValidationError) Reason() string { return e.reason } |
1784
|
|
|
|
1785
|
|
|
// Cause function returns cause value. |
1786
|
|
|
func (e PermissionExpandRequestValidationError) Cause() error { return e.cause } |
1787
|
|
|
|
1788
|
|
|
// Key function returns key value. |
1789
|
|
|
func (e PermissionExpandRequestValidationError) Key() bool { return e.key } |
1790
|
|
|
|
1791
|
|
|
// ErrorName returns error name. |
1792
|
|
|
func (e PermissionExpandRequestValidationError) ErrorName() string { |
1793
|
|
|
return "PermissionExpandRequestValidationError" |
1794
|
|
|
} |
1795
|
|
|
|
1796
|
|
|
// Error satisfies the builtin error interface |
1797
|
|
|
func (e PermissionExpandRequestValidationError) Error() string { |
1798
|
|
|
cause := "" |
1799
|
|
|
if e.cause != nil { |
1800
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1801
|
|
|
} |
1802
|
|
|
|
1803
|
|
|
key := "" |
1804
|
|
|
if e.key { |
1805
|
|
|
key = "key for " |
1806
|
|
|
} |
1807
|
|
|
|
1808
|
|
|
return fmt.Sprintf( |
1809
|
|
|
"invalid %sPermissionExpandRequest.%s: %s%s", |
1810
|
|
|
key, |
1811
|
|
|
e.field, |
1812
|
|
|
e.reason, |
1813
|
|
|
cause) |
1814
|
|
|
} |
1815
|
|
|
|
1816
|
|
|
var _ error = PermissionExpandRequestValidationError{} |
1817
|
|
|
|
1818
|
|
|
var _ interface { |
1819
|
|
|
Field() string |
1820
|
|
|
Reason() string |
1821
|
|
|
Key() bool |
1822
|
|
|
Cause() error |
1823
|
|
|
ErrorName() string |
1824
|
|
|
} = PermissionExpandRequestValidationError{} |
1825
|
|
|
|
1826
|
|
|
var _PermissionExpandRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
1827
|
|
|
|
1828
|
|
|
var _PermissionExpandRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1829
|
|
|
|
1830
|
|
|
// Validate checks the field values on PermissionExpandRequestMetadata with the |
1831
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1832
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1833
|
|
|
func (m *PermissionExpandRequestMetadata) Validate() error { |
1834
|
|
|
return m.validate(false) |
1835
|
|
|
} |
1836
|
|
|
|
1837
|
|
|
// ValidateAll checks the field values on PermissionExpandRequestMetadata with |
1838
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1839
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1840
|
|
|
// PermissionExpandRequestMetadataMultiError, or nil if none found. |
1841
|
|
|
func (m *PermissionExpandRequestMetadata) ValidateAll() error { |
1842
|
|
|
return m.validate(true) |
1843
|
|
|
} |
1844
|
|
|
|
1845
|
|
|
func (m *PermissionExpandRequestMetadata) validate(all bool) error { |
1846
|
|
|
if m == nil { |
1847
|
|
|
return nil |
1848
|
|
|
} |
1849
|
|
|
|
1850
|
|
|
var errors []error |
1851
|
|
|
|
1852
|
|
|
// no validation rules for SchemaVersion |
1853
|
|
|
|
1854
|
|
|
// no validation rules for SnapToken |
1855
|
|
|
|
1856
|
|
|
if len(errors) > 0 { |
1857
|
|
|
return PermissionExpandRequestMetadataMultiError(errors) |
1858
|
|
|
} |
1859
|
|
|
|
1860
|
|
|
return nil |
1861
|
|
|
} |
1862
|
|
|
|
1863
|
|
|
// PermissionExpandRequestMetadataMultiError is an error wrapping multiple |
1864
|
|
|
// validation errors returned by PermissionExpandRequestMetadata.ValidateAll() |
1865
|
|
|
// if the designated constraints aren't met. |
1866
|
|
|
type PermissionExpandRequestMetadataMultiError []error |
1867
|
|
|
|
1868
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1869
|
|
|
func (m PermissionExpandRequestMetadataMultiError) Error() string { |
1870
|
|
|
var msgs []string |
1871
|
|
|
for _, err := range m { |
1872
|
|
|
msgs = append(msgs, err.Error()) |
1873
|
|
|
} |
1874
|
|
|
return strings.Join(msgs, "; ") |
1875
|
|
|
} |
1876
|
|
|
|
1877
|
|
|
// AllErrors returns a list of validation violation errors. |
1878
|
|
|
func (m PermissionExpandRequestMetadataMultiError) AllErrors() []error { return m } |
1879
|
|
|
|
1880
|
|
|
// PermissionExpandRequestMetadataValidationError is the validation error |
1881
|
|
|
// returned by PermissionExpandRequestMetadata.Validate if the designated |
1882
|
|
|
// constraints aren't met. |
1883
|
|
|
type PermissionExpandRequestMetadataValidationError struct { |
1884
|
|
|
field string |
1885
|
|
|
reason string |
1886
|
|
|
cause error |
1887
|
|
|
key bool |
1888
|
|
|
} |
1889
|
|
|
|
1890
|
|
|
// Field function returns field value. |
1891
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Field() string { return e.field } |
1892
|
|
|
|
1893
|
|
|
// Reason function returns reason value. |
1894
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Reason() string { return e.reason } |
1895
|
|
|
|
1896
|
|
|
// Cause function returns cause value. |
1897
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Cause() error { return e.cause } |
1898
|
|
|
|
1899
|
|
|
// Key function returns key value. |
1900
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Key() bool { return e.key } |
1901
|
|
|
|
1902
|
|
|
// ErrorName returns error name. |
1903
|
|
|
func (e PermissionExpandRequestMetadataValidationError) ErrorName() string { |
1904
|
|
|
return "PermissionExpandRequestMetadataValidationError" |
1905
|
|
|
} |
1906
|
|
|
|
1907
|
|
|
// Error satisfies the builtin error interface |
1908
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Error() string { |
1909
|
|
|
cause := "" |
1910
|
|
|
if e.cause != nil { |
1911
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1912
|
|
|
} |
1913
|
|
|
|
1914
|
|
|
key := "" |
1915
|
|
|
if e.key { |
1916
|
|
|
key = "key for " |
1917
|
|
|
} |
1918
|
|
|
|
1919
|
|
|
return fmt.Sprintf( |
1920
|
|
|
"invalid %sPermissionExpandRequestMetadata.%s: %s%s", |
1921
|
|
|
key, |
1922
|
|
|
e.field, |
1923
|
|
|
e.reason, |
1924
|
|
|
cause) |
1925
|
|
|
} |
1926
|
|
|
|
1927
|
|
|
var _ error = PermissionExpandRequestMetadataValidationError{} |
1928
|
|
|
|
1929
|
|
|
var _ interface { |
1930
|
|
|
Field() string |
1931
|
|
|
Reason() string |
1932
|
|
|
Key() bool |
1933
|
|
|
Cause() error |
1934
|
|
|
ErrorName() string |
1935
|
|
|
} = PermissionExpandRequestMetadataValidationError{} |
1936
|
|
|
|
1937
|
|
|
// Validate checks the field values on PermissionExpandResponse with the rules |
1938
|
|
|
// defined in the proto definition for this message. If any rules are |
1939
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1940
|
|
|
func (m *PermissionExpandResponse) Validate() error { |
1941
|
|
|
return m.validate(false) |
1942
|
|
|
} |
1943
|
|
|
|
1944
|
|
|
// ValidateAll checks the field values on PermissionExpandResponse with the |
1945
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1946
|
|
|
// violated, the result is a list of violation errors wrapped in |
1947
|
|
|
// PermissionExpandResponseMultiError, or nil if none found. |
1948
|
|
|
func (m *PermissionExpandResponse) ValidateAll() error { |
1949
|
|
|
return m.validate(true) |
1950
|
|
|
} |
1951
|
|
|
|
1952
|
|
|
func (m *PermissionExpandResponse) validate(all bool) error { |
1953
|
|
|
if m == nil { |
1954
|
|
|
return nil |
1955
|
|
|
} |
1956
|
|
|
|
1957
|
|
|
var errors []error |
1958
|
|
|
|
1959
|
|
|
if all { |
1960
|
|
|
switch v := interface{}(m.GetTree()).(type) { |
1961
|
|
|
case interface{ ValidateAll() error }: |
1962
|
|
|
if err := v.ValidateAll(); err != nil { |
1963
|
|
|
errors = append(errors, PermissionExpandResponseValidationError{ |
1964
|
|
|
field: "Tree", |
1965
|
|
|
reason: "embedded message failed validation", |
1966
|
|
|
cause: err, |
1967
|
|
|
}) |
1968
|
|
|
} |
1969
|
|
|
case interface{ Validate() error }: |
1970
|
|
|
if err := v.Validate(); err != nil { |
1971
|
|
|
errors = append(errors, PermissionExpandResponseValidationError{ |
1972
|
|
|
field: "Tree", |
1973
|
|
|
reason: "embedded message failed validation", |
1974
|
|
|
cause: err, |
1975
|
|
|
}) |
1976
|
|
|
} |
1977
|
|
|
} |
1978
|
|
|
} else if v, ok := interface{}(m.GetTree()).(interface{ Validate() error }); ok { |
1979
|
|
|
if err := v.Validate(); err != nil { |
1980
|
|
|
return PermissionExpandResponseValidationError{ |
1981
|
|
|
field: "Tree", |
1982
|
|
|
reason: "embedded message failed validation", |
1983
|
|
|
cause: err, |
1984
|
|
|
} |
1985
|
|
|
} |
1986
|
|
|
} |
1987
|
|
|
|
1988
|
|
|
if len(errors) > 0 { |
1989
|
|
|
return PermissionExpandResponseMultiError(errors) |
1990
|
|
|
} |
1991
|
|
|
|
1992
|
|
|
return nil |
1993
|
|
|
} |
1994
|
|
|
|
1995
|
|
|
// PermissionExpandResponseMultiError is an error wrapping multiple validation |
1996
|
|
|
// errors returned by PermissionExpandResponse.ValidateAll() if the designated |
1997
|
|
|
// constraints aren't met. |
1998
|
|
|
type PermissionExpandResponseMultiError []error |
1999
|
|
|
|
2000
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2001
|
|
|
func (m PermissionExpandResponseMultiError) Error() string { |
2002
|
|
|
var msgs []string |
2003
|
|
|
for _, err := range m { |
2004
|
|
|
msgs = append(msgs, err.Error()) |
2005
|
|
|
} |
2006
|
|
|
return strings.Join(msgs, "; ") |
2007
|
|
|
} |
2008
|
|
|
|
2009
|
|
|
// AllErrors returns a list of validation violation errors. |
2010
|
|
|
func (m PermissionExpandResponseMultiError) AllErrors() []error { return m } |
2011
|
|
|
|
2012
|
|
|
// PermissionExpandResponseValidationError is the validation error returned by |
2013
|
|
|
// PermissionExpandResponse.Validate if the designated constraints aren't met. |
2014
|
|
|
type PermissionExpandResponseValidationError struct { |
2015
|
|
|
field string |
2016
|
|
|
reason string |
2017
|
|
|
cause error |
2018
|
|
|
key bool |
2019
|
|
|
} |
2020
|
|
|
|
2021
|
|
|
// Field function returns field value. |
2022
|
|
|
func (e PermissionExpandResponseValidationError) Field() string { return e.field } |
2023
|
|
|
|
2024
|
|
|
// Reason function returns reason value. |
2025
|
|
|
func (e PermissionExpandResponseValidationError) Reason() string { return e.reason } |
2026
|
|
|
|
2027
|
|
|
// Cause function returns cause value. |
2028
|
|
|
func (e PermissionExpandResponseValidationError) Cause() error { return e.cause } |
2029
|
|
|
|
2030
|
|
|
// Key function returns key value. |
2031
|
|
|
func (e PermissionExpandResponseValidationError) Key() bool { return e.key } |
2032
|
|
|
|
2033
|
|
|
// ErrorName returns error name. |
2034
|
|
|
func (e PermissionExpandResponseValidationError) ErrorName() string { |
2035
|
|
|
return "PermissionExpandResponseValidationError" |
2036
|
|
|
} |
2037
|
|
|
|
2038
|
|
|
// Error satisfies the builtin error interface |
2039
|
|
|
func (e PermissionExpandResponseValidationError) Error() string { |
2040
|
|
|
cause := "" |
2041
|
|
|
if e.cause != nil { |
2042
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2043
|
|
|
} |
2044
|
|
|
|
2045
|
|
|
key := "" |
2046
|
|
|
if e.key { |
2047
|
|
|
key = "key for " |
2048
|
|
|
} |
2049
|
|
|
|
2050
|
|
|
return fmt.Sprintf( |
2051
|
|
|
"invalid %sPermissionExpandResponse.%s: %s%s", |
2052
|
|
|
key, |
2053
|
|
|
e.field, |
2054
|
|
|
e.reason, |
2055
|
|
|
cause) |
2056
|
|
|
} |
2057
|
|
|
|
2058
|
|
|
var _ error = PermissionExpandResponseValidationError{} |
2059
|
|
|
|
2060
|
|
|
var _ interface { |
2061
|
|
|
Field() string |
2062
|
|
|
Reason() string |
2063
|
|
|
Key() bool |
2064
|
|
|
Cause() error |
2065
|
|
|
ErrorName() string |
2066
|
|
|
} = PermissionExpandResponseValidationError{} |
2067
|
|
|
|
2068
|
|
|
// Validate checks the field values on PermissionLookupEntityRequest with the |
2069
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2070
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2071
|
|
|
func (m *PermissionLookupEntityRequest) Validate() error { |
2072
|
|
|
return m.validate(false) |
2073
|
|
|
} |
2074
|
|
|
|
2075
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityRequest with |
2076
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2077
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2078
|
|
|
// PermissionLookupEntityRequestMultiError, or nil if none found. |
2079
|
|
|
func (m *PermissionLookupEntityRequest) ValidateAll() error { |
2080
|
|
|
return m.validate(true) |
2081
|
|
|
} |
2082
|
|
|
|
2083
|
|
|
func (m *PermissionLookupEntityRequest) validate(all bool) error { |
2084
|
|
|
if m == nil { |
2085
|
|
|
return nil |
2086
|
|
|
} |
2087
|
|
|
|
2088
|
|
|
var errors []error |
2089
|
|
|
|
2090
|
|
|
if len(m.GetTenantId()) > 128 { |
2091
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2092
|
|
|
field: "TenantId", |
2093
|
|
|
reason: "value length must be at most 128 bytes", |
2094
|
|
|
} |
2095
|
|
|
if !all { |
2096
|
|
|
return err |
2097
|
|
|
} |
2098
|
|
|
errors = append(errors, err) |
2099
|
|
|
} |
2100
|
|
|
|
2101
|
|
|
if !_PermissionLookupEntityRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
2102
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2103
|
|
|
field: "TenantId", |
2104
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
2105
|
|
|
} |
2106
|
|
|
if !all { |
2107
|
|
|
return err |
2108
|
|
|
} |
2109
|
|
|
errors = append(errors, err) |
2110
|
|
|
} |
2111
|
|
|
|
2112
|
|
|
if m.GetMetadata() == nil { |
2113
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2114
|
|
|
field: "Metadata", |
2115
|
|
|
reason: "value is required", |
2116
|
|
|
} |
2117
|
|
|
if !all { |
2118
|
|
|
return err |
2119
|
|
|
} |
2120
|
|
|
errors = append(errors, err) |
2121
|
|
|
} |
2122
|
|
|
|
2123
|
|
|
if all { |
2124
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
2125
|
|
|
case interface{ ValidateAll() error }: |
2126
|
|
|
if err := v.ValidateAll(); err != nil { |
2127
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2128
|
|
|
field: "Metadata", |
2129
|
|
|
reason: "embedded message failed validation", |
2130
|
|
|
cause: err, |
2131
|
|
|
}) |
2132
|
|
|
} |
2133
|
|
|
case interface{ Validate() error }: |
2134
|
|
|
if err := v.Validate(); err != nil { |
2135
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2136
|
|
|
field: "Metadata", |
2137
|
|
|
reason: "embedded message failed validation", |
2138
|
|
|
cause: err, |
2139
|
|
|
}) |
2140
|
|
|
} |
2141
|
|
|
} |
2142
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
2143
|
|
|
if err := v.Validate(); err != nil { |
2144
|
|
|
return PermissionLookupEntityRequestValidationError{ |
2145
|
|
|
field: "Metadata", |
2146
|
|
|
reason: "embedded message failed validation", |
2147
|
|
|
cause: err, |
2148
|
|
|
} |
2149
|
|
|
} |
2150
|
|
|
} |
2151
|
|
|
|
2152
|
|
|
if len(m.GetEntityType()) > 64 { |
2153
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2154
|
|
|
field: "EntityType", |
2155
|
|
|
reason: "value length must be at most 64 bytes", |
2156
|
|
|
} |
2157
|
|
|
if !all { |
2158
|
|
|
return err |
2159
|
|
|
} |
2160
|
|
|
errors = append(errors, err) |
2161
|
|
|
} |
2162
|
|
|
|
2163
|
|
|
if !_PermissionLookupEntityRequest_EntityType_Pattern.MatchString(m.GetEntityType()) { |
2164
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2165
|
|
|
field: "EntityType", |
2166
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
2167
|
|
|
} |
2168
|
|
|
if !all { |
2169
|
|
|
return err |
2170
|
|
|
} |
2171
|
|
|
errors = append(errors, err) |
2172
|
|
|
} |
2173
|
|
|
|
2174
|
|
|
if len(m.GetPermission()) > 64 { |
2175
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2176
|
|
|
field: "Permission", |
2177
|
|
|
reason: "value length must be at most 64 bytes", |
2178
|
|
|
} |
2179
|
|
|
if !all { |
2180
|
|
|
return err |
2181
|
|
|
} |
2182
|
|
|
errors = append(errors, err) |
2183
|
|
|
} |
2184
|
|
|
|
2185
|
|
|
if !_PermissionLookupEntityRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
2186
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2187
|
|
|
field: "Permission", |
2188
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
2189
|
|
|
} |
2190
|
|
|
if !all { |
2191
|
|
|
return err |
2192
|
|
|
} |
2193
|
|
|
errors = append(errors, err) |
2194
|
|
|
} |
2195
|
|
|
|
2196
|
|
|
if m.GetSubject() == nil { |
2197
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2198
|
|
|
field: "Subject", |
2199
|
|
|
reason: "value is required", |
2200
|
|
|
} |
2201
|
|
|
if !all { |
2202
|
|
|
return err |
2203
|
|
|
} |
2204
|
|
|
errors = append(errors, err) |
2205
|
|
|
} |
2206
|
|
|
|
2207
|
|
|
if all { |
2208
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
2209
|
|
|
case interface{ ValidateAll() error }: |
2210
|
|
|
if err := v.ValidateAll(); err != nil { |
2211
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2212
|
|
|
field: "Subject", |
2213
|
|
|
reason: "embedded message failed validation", |
2214
|
|
|
cause: err, |
2215
|
|
|
}) |
2216
|
|
|
} |
2217
|
|
|
case interface{ Validate() error }: |
2218
|
|
|
if err := v.Validate(); err != nil { |
2219
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2220
|
|
|
field: "Subject", |
2221
|
|
|
reason: "embedded message failed validation", |
2222
|
|
|
cause: err, |
2223
|
|
|
}) |
2224
|
|
|
} |
2225
|
|
|
} |
2226
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
2227
|
|
|
if err := v.Validate(); err != nil { |
2228
|
|
|
return PermissionLookupEntityRequestValidationError{ |
2229
|
|
|
field: "Subject", |
2230
|
|
|
reason: "embedded message failed validation", |
2231
|
|
|
cause: err, |
2232
|
|
|
} |
2233
|
|
|
} |
2234
|
|
|
} |
2235
|
|
|
|
2236
|
|
|
if all { |
2237
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
2238
|
|
|
case interface{ ValidateAll() error }: |
2239
|
|
|
if err := v.ValidateAll(); err != nil { |
2240
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2241
|
|
|
field: "Context", |
2242
|
|
|
reason: "embedded message failed validation", |
2243
|
|
|
cause: err, |
2244
|
|
|
}) |
2245
|
|
|
} |
2246
|
|
|
case interface{ Validate() error }: |
2247
|
|
|
if err := v.Validate(); err != nil { |
2248
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2249
|
|
|
field: "Context", |
2250
|
|
|
reason: "embedded message failed validation", |
2251
|
|
|
cause: err, |
2252
|
|
|
}) |
2253
|
|
|
} |
2254
|
|
|
} |
2255
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
2256
|
|
|
if err := v.Validate(); err != nil { |
2257
|
|
|
return PermissionLookupEntityRequestValidationError{ |
2258
|
|
|
field: "Context", |
2259
|
|
|
reason: "embedded message failed validation", |
2260
|
|
|
cause: err, |
2261
|
|
|
} |
2262
|
|
|
} |
2263
|
|
|
} |
2264
|
|
|
|
2265
|
|
|
{ |
2266
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
2267
|
|
|
i := 0 |
2268
|
|
|
for key := range m.GetScope() { |
2269
|
|
|
sorted_keys[i] = key |
2270
|
|
|
i++ |
2271
|
|
|
} |
2272
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
2273
|
|
|
for _, key := range sorted_keys { |
2274
|
|
|
val := m.GetScope()[key] |
2275
|
|
|
_ = val |
2276
|
|
|
|
2277
|
|
|
// no validation rules for Scope[key] |
2278
|
|
|
|
2279
|
|
|
if all { |
2280
|
|
|
switch v := interface{}(val).(type) { |
2281
|
|
|
case interface{ ValidateAll() error }: |
2282
|
|
|
if err := v.ValidateAll(); err != nil { |
2283
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2284
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2285
|
|
|
reason: "embedded message failed validation", |
2286
|
|
|
cause: err, |
2287
|
|
|
}) |
2288
|
|
|
} |
2289
|
|
|
case interface{ Validate() error }: |
2290
|
|
|
if err := v.Validate(); err != nil { |
2291
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
2292
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2293
|
|
|
reason: "embedded message failed validation", |
2294
|
|
|
cause: err, |
2295
|
|
|
}) |
2296
|
|
|
} |
2297
|
|
|
} |
2298
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
2299
|
|
|
if err := v.Validate(); err != nil { |
2300
|
|
|
return PermissionLookupEntityRequestValidationError{ |
2301
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2302
|
|
|
reason: "embedded message failed validation", |
2303
|
|
|
cause: err, |
2304
|
|
|
} |
2305
|
|
|
} |
2306
|
|
|
} |
2307
|
|
|
|
2308
|
|
|
} |
2309
|
|
|
} |
2310
|
|
|
|
2311
|
|
|
if m.GetPageSize() != 0 { |
2312
|
|
|
|
2313
|
|
|
if m.GetPageSize() < 1 { |
2314
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
2315
|
|
|
field: "PageSize", |
2316
|
|
|
reason: "value must be greater than or equal to 1", |
2317
|
|
|
} |
2318
|
|
|
if !all { |
2319
|
|
|
return err |
2320
|
|
|
} |
2321
|
|
|
errors = append(errors, err) |
2322
|
|
|
} |
2323
|
|
|
|
2324
|
|
|
} |
2325
|
|
|
|
2326
|
|
|
if m.GetContinuousToken() != "" { |
2327
|
|
|
|
2328
|
|
|
} |
2329
|
|
|
|
2330
|
|
|
if len(errors) > 0 { |
2331
|
|
|
return PermissionLookupEntityRequestMultiError(errors) |
2332
|
|
|
} |
2333
|
|
|
|
2334
|
|
|
return nil |
2335
|
|
|
} |
2336
|
|
|
|
2337
|
|
|
// PermissionLookupEntityRequestMultiError is an error wrapping multiple |
2338
|
|
|
// validation errors returned by PermissionLookupEntityRequest.ValidateAll() |
2339
|
|
|
// if the designated constraints aren't met. |
2340
|
|
|
type PermissionLookupEntityRequestMultiError []error |
2341
|
|
|
|
2342
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2343
|
|
|
func (m PermissionLookupEntityRequestMultiError) Error() string { |
2344
|
|
|
var msgs []string |
2345
|
|
|
for _, err := range m { |
2346
|
|
|
msgs = append(msgs, err.Error()) |
2347
|
|
|
} |
2348
|
|
|
return strings.Join(msgs, "; ") |
2349
|
|
|
} |
2350
|
|
|
|
2351
|
|
|
// AllErrors returns a list of validation violation errors. |
2352
|
|
|
func (m PermissionLookupEntityRequestMultiError) AllErrors() []error { return m } |
2353
|
|
|
|
2354
|
|
|
// PermissionLookupEntityRequestValidationError is the validation error |
2355
|
|
|
// returned by PermissionLookupEntityRequest.Validate if the designated |
2356
|
|
|
// constraints aren't met. |
2357
|
|
|
type PermissionLookupEntityRequestValidationError struct { |
2358
|
|
|
field string |
2359
|
|
|
reason string |
2360
|
|
|
cause error |
2361
|
|
|
key bool |
2362
|
|
|
} |
2363
|
|
|
|
2364
|
|
|
// Field function returns field value. |
2365
|
|
|
func (e PermissionLookupEntityRequestValidationError) Field() string { return e.field } |
2366
|
|
|
|
2367
|
|
|
// Reason function returns reason value. |
2368
|
|
|
func (e PermissionLookupEntityRequestValidationError) Reason() string { return e.reason } |
2369
|
|
|
|
2370
|
|
|
// Cause function returns cause value. |
2371
|
|
|
func (e PermissionLookupEntityRequestValidationError) Cause() error { return e.cause } |
2372
|
|
|
|
2373
|
|
|
// Key function returns key value. |
2374
|
|
|
func (e PermissionLookupEntityRequestValidationError) Key() bool { return e.key } |
2375
|
|
|
|
2376
|
|
|
// ErrorName returns error name. |
2377
|
|
|
func (e PermissionLookupEntityRequestValidationError) ErrorName() string { |
2378
|
|
|
return "PermissionLookupEntityRequestValidationError" |
2379
|
|
|
} |
2380
|
|
|
|
2381
|
|
|
// Error satisfies the builtin error interface |
2382
|
|
|
func (e PermissionLookupEntityRequestValidationError) Error() string { |
2383
|
|
|
cause := "" |
2384
|
|
|
if e.cause != nil { |
2385
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2386
|
|
|
} |
2387
|
|
|
|
2388
|
|
|
key := "" |
2389
|
|
|
if e.key { |
2390
|
|
|
key = "key for " |
2391
|
|
|
} |
2392
|
|
|
|
2393
|
|
|
return fmt.Sprintf( |
2394
|
|
|
"invalid %sPermissionLookupEntityRequest.%s: %s%s", |
2395
|
|
|
key, |
2396
|
|
|
e.field, |
2397
|
|
|
e.reason, |
2398
|
|
|
cause) |
2399
|
|
|
} |
2400
|
|
|
|
2401
|
|
|
var _ error = PermissionLookupEntityRequestValidationError{} |
2402
|
|
|
|
2403
|
|
|
var _ interface { |
2404
|
|
|
Field() string |
2405
|
|
|
Reason() string |
2406
|
|
|
Key() bool |
2407
|
|
|
Cause() error |
2408
|
|
|
ErrorName() string |
2409
|
|
|
} = PermissionLookupEntityRequestValidationError{} |
2410
|
|
|
|
2411
|
|
|
var _PermissionLookupEntityRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
2412
|
|
|
|
2413
|
|
|
var _PermissionLookupEntityRequest_EntityType_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
2414
|
|
|
|
2415
|
|
|
var _PermissionLookupEntityRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
2416
|
|
|
|
2417
|
|
|
// Validate checks the field values on PermissionLookupEntityRequestMetadata |
2418
|
|
|
// with the rules defined in the proto definition for this message. If any |
2419
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2420
|
|
|
// there are no violations. |
2421
|
|
|
func (m *PermissionLookupEntityRequestMetadata) Validate() error { |
2422
|
|
|
return m.validate(false) |
2423
|
|
|
} |
2424
|
|
|
|
2425
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityRequestMetadata |
2426
|
|
|
// with the rules defined in the proto definition for this message. If any |
2427
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2428
|
|
|
// PermissionLookupEntityRequestMetadataMultiError, or nil if none found. |
2429
|
|
|
func (m *PermissionLookupEntityRequestMetadata) ValidateAll() error { |
2430
|
|
|
return m.validate(true) |
2431
|
|
|
} |
2432
|
|
|
|
2433
|
|
|
func (m *PermissionLookupEntityRequestMetadata) validate(all bool) error { |
2434
|
|
|
if m == nil { |
2435
|
|
|
return nil |
2436
|
|
|
} |
2437
|
|
|
|
2438
|
|
|
var errors []error |
2439
|
|
|
|
2440
|
|
|
// no validation rules for SchemaVersion |
2441
|
|
|
|
2442
|
|
|
// no validation rules for SnapToken |
2443
|
|
|
|
2444
|
|
|
if m.GetDepth() < 3 { |
2445
|
|
|
err := PermissionLookupEntityRequestMetadataValidationError{ |
2446
|
|
|
field: "Depth", |
2447
|
|
|
reason: "value must be greater than or equal to 3", |
2448
|
|
|
} |
2449
|
|
|
if !all { |
2450
|
|
|
return err |
2451
|
|
|
} |
2452
|
|
|
errors = append(errors, err) |
2453
|
|
|
} |
2454
|
|
|
|
2455
|
|
|
if len(errors) > 0 { |
2456
|
|
|
return PermissionLookupEntityRequestMetadataMultiError(errors) |
2457
|
|
|
} |
2458
|
|
|
|
2459
|
|
|
return nil |
2460
|
|
|
} |
2461
|
|
|
|
2462
|
|
|
// PermissionLookupEntityRequestMetadataMultiError is an error wrapping |
2463
|
|
|
// multiple validation errors returned by |
2464
|
|
|
// PermissionLookupEntityRequestMetadata.ValidateAll() if the designated |
2465
|
|
|
// constraints aren't met. |
2466
|
|
|
type PermissionLookupEntityRequestMetadataMultiError []error |
2467
|
|
|
|
2468
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2469
|
|
|
func (m PermissionLookupEntityRequestMetadataMultiError) Error() string { |
2470
|
|
|
var msgs []string |
2471
|
|
|
for _, err := range m { |
2472
|
|
|
msgs = append(msgs, err.Error()) |
2473
|
|
|
} |
2474
|
|
|
return strings.Join(msgs, "; ") |
2475
|
|
|
} |
2476
|
|
|
|
2477
|
|
|
// AllErrors returns a list of validation violation errors. |
2478
|
|
|
func (m PermissionLookupEntityRequestMetadataMultiError) AllErrors() []error { return m } |
2479
|
|
|
|
2480
|
|
|
// PermissionLookupEntityRequestMetadataValidationError is the validation error |
2481
|
|
|
// returned by PermissionLookupEntityRequestMetadata.Validate if the |
2482
|
|
|
// designated constraints aren't met. |
2483
|
|
|
type PermissionLookupEntityRequestMetadataValidationError struct { |
2484
|
|
|
field string |
2485
|
|
|
reason string |
2486
|
|
|
cause error |
2487
|
|
|
key bool |
2488
|
|
|
} |
2489
|
|
|
|
2490
|
|
|
// Field function returns field value. |
2491
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Field() string { return e.field } |
2492
|
|
|
|
2493
|
|
|
// Reason function returns reason value. |
2494
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Reason() string { return e.reason } |
2495
|
|
|
|
2496
|
|
|
// Cause function returns cause value. |
2497
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Cause() error { return e.cause } |
2498
|
|
|
|
2499
|
|
|
// Key function returns key value. |
2500
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Key() bool { return e.key } |
2501
|
|
|
|
2502
|
|
|
// ErrorName returns error name. |
2503
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) ErrorName() string { |
2504
|
|
|
return "PermissionLookupEntityRequestMetadataValidationError" |
2505
|
|
|
} |
2506
|
|
|
|
2507
|
|
|
// Error satisfies the builtin error interface |
2508
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Error() string { |
2509
|
|
|
cause := "" |
2510
|
|
|
if e.cause != nil { |
2511
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2512
|
|
|
} |
2513
|
|
|
|
2514
|
|
|
key := "" |
2515
|
|
|
if e.key { |
2516
|
|
|
key = "key for " |
2517
|
|
|
} |
2518
|
|
|
|
2519
|
|
|
return fmt.Sprintf( |
2520
|
|
|
"invalid %sPermissionLookupEntityRequestMetadata.%s: %s%s", |
2521
|
|
|
key, |
2522
|
|
|
e.field, |
2523
|
|
|
e.reason, |
2524
|
|
|
cause) |
2525
|
|
|
} |
2526
|
|
|
|
2527
|
|
|
var _ error = PermissionLookupEntityRequestMetadataValidationError{} |
2528
|
|
|
|
2529
|
|
|
var _ interface { |
2530
|
|
|
Field() string |
2531
|
|
|
Reason() string |
2532
|
|
|
Key() bool |
2533
|
|
|
Cause() error |
2534
|
|
|
ErrorName() string |
2535
|
|
|
} = PermissionLookupEntityRequestMetadataValidationError{} |
2536
|
|
|
|
2537
|
|
|
// Validate checks the field values on PermissionLookupEntityResponse with the |
2538
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2539
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2540
|
|
|
func (m *PermissionLookupEntityResponse) Validate() error { |
2541
|
|
|
return m.validate(false) |
2542
|
|
|
} |
2543
|
|
|
|
2544
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityResponse with |
2545
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2546
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2547
|
|
|
// PermissionLookupEntityResponseMultiError, or nil if none found. |
2548
|
|
|
func (m *PermissionLookupEntityResponse) ValidateAll() error { |
2549
|
|
|
return m.validate(true) |
2550
|
|
|
} |
2551
|
|
|
|
2552
|
|
|
func (m *PermissionLookupEntityResponse) validate(all bool) error { |
2553
|
|
|
if m == nil { |
2554
|
|
|
return nil |
2555
|
|
|
} |
2556
|
|
|
|
2557
|
|
|
var errors []error |
2558
|
|
|
|
2559
|
|
|
// no validation rules for ContinuousToken |
2560
|
|
|
|
2561
|
|
|
if len(errors) > 0 { |
2562
|
|
|
return PermissionLookupEntityResponseMultiError(errors) |
2563
|
|
|
} |
2564
|
|
|
|
2565
|
|
|
return nil |
2566
|
|
|
} |
2567
|
|
|
|
2568
|
|
|
// PermissionLookupEntityResponseMultiError is an error wrapping multiple |
2569
|
|
|
// validation errors returned by PermissionLookupEntityResponse.ValidateAll() |
2570
|
|
|
// if the designated constraints aren't met. |
2571
|
|
|
type PermissionLookupEntityResponseMultiError []error |
2572
|
|
|
|
2573
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2574
|
|
|
func (m PermissionLookupEntityResponseMultiError) Error() string { |
2575
|
|
|
var msgs []string |
2576
|
|
|
for _, err := range m { |
2577
|
|
|
msgs = append(msgs, err.Error()) |
2578
|
|
|
} |
2579
|
|
|
return strings.Join(msgs, "; ") |
2580
|
|
|
} |
2581
|
|
|
|
2582
|
|
|
// AllErrors returns a list of validation violation errors. |
2583
|
|
|
func (m PermissionLookupEntityResponseMultiError) AllErrors() []error { return m } |
2584
|
|
|
|
2585
|
|
|
// PermissionLookupEntityResponseValidationError is the validation error |
2586
|
|
|
// returned by PermissionLookupEntityResponse.Validate if the designated |
2587
|
|
|
// constraints aren't met. |
2588
|
|
|
type PermissionLookupEntityResponseValidationError struct { |
2589
|
|
|
field string |
2590
|
|
|
reason string |
2591
|
|
|
cause error |
2592
|
|
|
key bool |
2593
|
|
|
} |
2594
|
|
|
|
2595
|
|
|
// Field function returns field value. |
2596
|
|
|
func (e PermissionLookupEntityResponseValidationError) Field() string { return e.field } |
2597
|
|
|
|
2598
|
|
|
// Reason function returns reason value. |
2599
|
|
|
func (e PermissionLookupEntityResponseValidationError) Reason() string { return e.reason } |
2600
|
|
|
|
2601
|
|
|
// Cause function returns cause value. |
2602
|
|
|
func (e PermissionLookupEntityResponseValidationError) Cause() error { return e.cause } |
2603
|
|
|
|
2604
|
|
|
// Key function returns key value. |
2605
|
|
|
func (e PermissionLookupEntityResponseValidationError) Key() bool { return e.key } |
2606
|
|
|
|
2607
|
|
|
// ErrorName returns error name. |
2608
|
|
|
func (e PermissionLookupEntityResponseValidationError) ErrorName() string { |
2609
|
|
|
return "PermissionLookupEntityResponseValidationError" |
2610
|
|
|
} |
2611
|
|
|
|
2612
|
|
|
// Error satisfies the builtin error interface |
2613
|
|
|
func (e PermissionLookupEntityResponseValidationError) Error() string { |
2614
|
|
|
cause := "" |
2615
|
|
|
if e.cause != nil { |
2616
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2617
|
|
|
} |
2618
|
|
|
|
2619
|
|
|
key := "" |
2620
|
|
|
if e.key { |
2621
|
|
|
key = "key for " |
2622
|
|
|
} |
2623
|
|
|
|
2624
|
|
|
return fmt.Sprintf( |
2625
|
|
|
"invalid %sPermissionLookupEntityResponse.%s: %s%s", |
2626
|
|
|
key, |
2627
|
|
|
e.field, |
2628
|
|
|
e.reason, |
2629
|
|
|
cause) |
2630
|
|
|
} |
2631
|
|
|
|
2632
|
|
|
var _ error = PermissionLookupEntityResponseValidationError{} |
2633
|
|
|
|
2634
|
|
|
var _ interface { |
2635
|
|
|
Field() string |
2636
|
|
|
Reason() string |
2637
|
|
|
Key() bool |
2638
|
|
|
Cause() error |
2639
|
|
|
ErrorName() string |
2640
|
|
|
} = PermissionLookupEntityResponseValidationError{} |
2641
|
|
|
|
2642
|
|
|
// Validate checks the field values on PermissionLookupEntityStreamResponse |
2643
|
|
|
// with the rules defined in the proto definition for this message. If any |
2644
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2645
|
|
|
// there are no violations. |
2646
|
|
|
func (m *PermissionLookupEntityStreamResponse) Validate() error { |
2647
|
|
|
return m.validate(false) |
2648
|
|
|
} |
2649
|
|
|
|
2650
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityStreamResponse |
2651
|
|
|
// with the rules defined in the proto definition for this message. If any |
2652
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2653
|
|
|
// PermissionLookupEntityStreamResponseMultiError, or nil if none found. |
2654
|
|
|
func (m *PermissionLookupEntityStreamResponse) ValidateAll() error { |
2655
|
|
|
return m.validate(true) |
2656
|
|
|
} |
2657
|
|
|
|
2658
|
|
|
func (m *PermissionLookupEntityStreamResponse) validate(all bool) error { |
2659
|
|
|
if m == nil { |
2660
|
|
|
return nil |
2661
|
|
|
} |
2662
|
|
|
|
2663
|
|
|
var errors []error |
2664
|
|
|
|
2665
|
|
|
// no validation rules for EntityId |
2666
|
|
|
|
2667
|
|
|
// no validation rules for ContinuousToken |
2668
|
|
|
|
2669
|
|
|
if len(errors) > 0 { |
2670
|
|
|
return PermissionLookupEntityStreamResponseMultiError(errors) |
2671
|
|
|
} |
2672
|
|
|
|
2673
|
|
|
return nil |
2674
|
|
|
} |
2675
|
|
|
|
2676
|
|
|
// PermissionLookupEntityStreamResponseMultiError is an error wrapping multiple |
2677
|
|
|
// validation errors returned by |
2678
|
|
|
// PermissionLookupEntityStreamResponse.ValidateAll() if the designated |
2679
|
|
|
// constraints aren't met. |
2680
|
|
|
type PermissionLookupEntityStreamResponseMultiError []error |
2681
|
|
|
|
2682
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2683
|
|
|
func (m PermissionLookupEntityStreamResponseMultiError) Error() string { |
2684
|
|
|
var msgs []string |
2685
|
|
|
for _, err := range m { |
2686
|
|
|
msgs = append(msgs, err.Error()) |
2687
|
|
|
} |
2688
|
|
|
return strings.Join(msgs, "; ") |
2689
|
|
|
} |
2690
|
|
|
|
2691
|
|
|
// AllErrors returns a list of validation violation errors. |
2692
|
|
|
func (m PermissionLookupEntityStreamResponseMultiError) AllErrors() []error { return m } |
2693
|
|
|
|
2694
|
|
|
// PermissionLookupEntityStreamResponseValidationError is the validation error |
2695
|
|
|
// returned by PermissionLookupEntityStreamResponse.Validate if the designated |
2696
|
|
|
// constraints aren't met. |
2697
|
|
|
type PermissionLookupEntityStreamResponseValidationError struct { |
2698
|
|
|
field string |
2699
|
|
|
reason string |
2700
|
|
|
cause error |
2701
|
|
|
key bool |
2702
|
|
|
} |
2703
|
|
|
|
2704
|
|
|
// Field function returns field value. |
2705
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Field() string { return e.field } |
2706
|
|
|
|
2707
|
|
|
// Reason function returns reason value. |
2708
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Reason() string { return e.reason } |
2709
|
|
|
|
2710
|
|
|
// Cause function returns cause value. |
2711
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Cause() error { return e.cause } |
2712
|
|
|
|
2713
|
|
|
// Key function returns key value. |
2714
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Key() bool { return e.key } |
2715
|
|
|
|
2716
|
|
|
// ErrorName returns error name. |
2717
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) ErrorName() string { |
2718
|
|
|
return "PermissionLookupEntityStreamResponseValidationError" |
2719
|
|
|
} |
2720
|
|
|
|
2721
|
|
|
// Error satisfies the builtin error interface |
2722
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Error() string { |
2723
|
|
|
cause := "" |
2724
|
|
|
if e.cause != nil { |
2725
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2726
|
|
|
} |
2727
|
|
|
|
2728
|
|
|
key := "" |
2729
|
|
|
if e.key { |
2730
|
|
|
key = "key for " |
2731
|
|
|
} |
2732
|
|
|
|
2733
|
|
|
return fmt.Sprintf( |
2734
|
|
|
"invalid %sPermissionLookupEntityStreamResponse.%s: %s%s", |
2735
|
|
|
key, |
2736
|
|
|
e.field, |
2737
|
|
|
e.reason, |
2738
|
|
|
cause) |
2739
|
|
|
} |
2740
|
|
|
|
2741
|
|
|
var _ error = PermissionLookupEntityStreamResponseValidationError{} |
2742
|
|
|
|
2743
|
|
|
var _ interface { |
2744
|
|
|
Field() string |
2745
|
|
|
Reason() string |
2746
|
|
|
Key() bool |
2747
|
|
|
Cause() error |
2748
|
|
|
ErrorName() string |
2749
|
|
|
} = PermissionLookupEntityStreamResponseValidationError{} |
2750
|
|
|
|
2751
|
|
|
// Validate checks the field values on PermissionEntityFilterRequest with the |
2752
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2753
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2754
|
|
|
func (m *PermissionEntityFilterRequest) Validate() error { |
2755
|
|
|
return m.validate(false) |
2756
|
|
|
} |
2757
|
|
|
|
2758
|
|
|
// ValidateAll checks the field values on PermissionEntityFilterRequest with |
2759
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2760
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2761
|
|
|
// PermissionEntityFilterRequestMultiError, or nil if none found. |
2762
|
|
|
func (m *PermissionEntityFilterRequest) ValidateAll() error { |
2763
|
|
|
return m.validate(true) |
2764
|
|
|
} |
2765
|
|
|
|
2766
|
|
|
func (m *PermissionEntityFilterRequest) validate(all bool) error { |
2767
|
|
|
if m == nil { |
2768
|
|
|
return nil |
2769
|
|
|
} |
2770
|
|
|
|
2771
|
|
|
var errors []error |
2772
|
|
|
|
2773
|
|
|
if len(m.GetTenantId()) > 128 { |
2774
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
2775
|
|
|
field: "TenantId", |
2776
|
|
|
reason: "value length must be at most 128 bytes", |
2777
|
|
|
} |
2778
|
|
|
if !all { |
2779
|
|
|
return err |
2780
|
|
|
} |
2781
|
|
|
errors = append(errors, err) |
2782
|
|
|
} |
2783
|
|
|
|
2784
|
|
|
if !_PermissionEntityFilterRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
2785
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
2786
|
|
|
field: "TenantId", |
2787
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
2788
|
|
|
} |
2789
|
|
|
if !all { |
2790
|
|
|
return err |
2791
|
|
|
} |
2792
|
|
|
errors = append(errors, err) |
2793
|
|
|
} |
2794
|
|
|
|
2795
|
|
|
if m.GetMetadata() == nil { |
2796
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
2797
|
|
|
field: "Metadata", |
2798
|
|
|
reason: "value is required", |
2799
|
|
|
} |
2800
|
|
|
if !all { |
2801
|
|
|
return err |
2802
|
|
|
} |
2803
|
|
|
errors = append(errors, err) |
2804
|
|
|
} |
2805
|
|
|
|
2806
|
|
|
if all { |
2807
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
2808
|
|
|
case interface{ ValidateAll() error }: |
2809
|
|
|
if err := v.ValidateAll(); err != nil { |
2810
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2811
|
|
|
field: "Metadata", |
2812
|
|
|
reason: "embedded message failed validation", |
2813
|
|
|
cause: err, |
2814
|
|
|
}) |
2815
|
|
|
} |
2816
|
|
|
case interface{ Validate() error }: |
2817
|
|
|
if err := v.Validate(); err != nil { |
2818
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2819
|
|
|
field: "Metadata", |
2820
|
|
|
reason: "embedded message failed validation", |
2821
|
|
|
cause: err, |
2822
|
|
|
}) |
2823
|
|
|
} |
2824
|
|
|
} |
2825
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
2826
|
|
|
if err := v.Validate(); err != nil { |
2827
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2828
|
|
|
field: "Metadata", |
2829
|
|
|
reason: "embedded message failed validation", |
2830
|
|
|
cause: err, |
2831
|
|
|
} |
2832
|
|
|
} |
2833
|
|
|
} |
2834
|
|
|
|
2835
|
|
|
if all { |
2836
|
|
|
switch v := interface{}(m.GetEntrance()).(type) { |
2837
|
|
|
case interface{ ValidateAll() error }: |
2838
|
|
|
if err := v.ValidateAll(); err != nil { |
2839
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2840
|
|
|
field: "Entrance", |
2841
|
|
|
reason: "embedded message failed validation", |
2842
|
|
|
cause: err, |
2843
|
|
|
}) |
2844
|
|
|
} |
2845
|
|
|
case interface{ Validate() error }: |
2846
|
|
|
if err := v.Validate(); err != nil { |
2847
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2848
|
|
|
field: "Entrance", |
2849
|
|
|
reason: "embedded message failed validation", |
2850
|
|
|
cause: err, |
2851
|
|
|
}) |
2852
|
|
|
} |
2853
|
|
|
} |
2854
|
|
|
} else if v, ok := interface{}(m.GetEntrance()).(interface{ Validate() error }); ok { |
2855
|
|
|
if err := v.Validate(); err != nil { |
2856
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2857
|
|
|
field: "Entrance", |
2858
|
|
|
reason: "embedded message failed validation", |
2859
|
|
|
cause: err, |
2860
|
|
|
} |
2861
|
|
|
} |
2862
|
|
|
} |
2863
|
|
|
|
2864
|
|
|
if all { |
2865
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
2866
|
|
|
case interface{ ValidateAll() error }: |
2867
|
|
|
if err := v.ValidateAll(); err != nil { |
2868
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2869
|
|
|
field: "Subject", |
2870
|
|
|
reason: "embedded message failed validation", |
2871
|
|
|
cause: err, |
2872
|
|
|
}) |
2873
|
|
|
} |
2874
|
|
|
case interface{ Validate() error }: |
2875
|
|
|
if err := v.Validate(); err != nil { |
2876
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2877
|
|
|
field: "Subject", |
2878
|
|
|
reason: "embedded message failed validation", |
2879
|
|
|
cause: err, |
2880
|
|
|
}) |
2881
|
|
|
} |
2882
|
|
|
} |
2883
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
2884
|
|
|
if err := v.Validate(); err != nil { |
2885
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2886
|
|
|
field: "Subject", |
2887
|
|
|
reason: "embedded message failed validation", |
2888
|
|
|
cause: err, |
2889
|
|
|
} |
2890
|
|
|
} |
2891
|
|
|
} |
2892
|
|
|
|
2893
|
|
|
if all { |
2894
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
2895
|
|
|
case interface{ ValidateAll() error }: |
2896
|
|
|
if err := v.ValidateAll(); err != nil { |
2897
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2898
|
|
|
field: "Context", |
2899
|
|
|
reason: "embedded message failed validation", |
2900
|
|
|
cause: err, |
2901
|
|
|
}) |
2902
|
|
|
} |
2903
|
|
|
case interface{ Validate() error }: |
2904
|
|
|
if err := v.Validate(); err != nil { |
2905
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2906
|
|
|
field: "Context", |
2907
|
|
|
reason: "embedded message failed validation", |
2908
|
|
|
cause: err, |
2909
|
|
|
}) |
2910
|
|
|
} |
2911
|
|
|
} |
2912
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
2913
|
|
|
if err := v.Validate(); err != nil { |
2914
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2915
|
|
|
field: "Context", |
2916
|
|
|
reason: "embedded message failed validation", |
2917
|
|
|
cause: err, |
2918
|
|
|
} |
2919
|
|
|
} |
2920
|
|
|
} |
2921
|
|
|
|
2922
|
|
|
{ |
2923
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
2924
|
|
|
i := 0 |
2925
|
|
|
for key := range m.GetScope() { |
2926
|
|
|
sorted_keys[i] = key |
2927
|
|
|
i++ |
2928
|
|
|
} |
2929
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
2930
|
|
|
for _, key := range sorted_keys { |
2931
|
|
|
val := m.GetScope()[key] |
2932
|
|
|
_ = val |
2933
|
|
|
|
2934
|
|
|
// no validation rules for Scope[key] |
2935
|
|
|
|
2936
|
|
|
if all { |
2937
|
|
|
switch v := interface{}(val).(type) { |
2938
|
|
|
case interface{ ValidateAll() error }: |
2939
|
|
|
if err := v.ValidateAll(); err != nil { |
2940
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2941
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2942
|
|
|
reason: "embedded message failed validation", |
2943
|
|
|
cause: err, |
2944
|
|
|
}) |
2945
|
|
|
} |
2946
|
|
|
case interface{ Validate() error }: |
2947
|
|
|
if err := v.Validate(); err != nil { |
2948
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2949
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2950
|
|
|
reason: "embedded message failed validation", |
2951
|
|
|
cause: err, |
2952
|
|
|
}) |
2953
|
|
|
} |
2954
|
|
|
} |
2955
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
2956
|
|
|
if err := v.Validate(); err != nil { |
2957
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2958
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2959
|
|
|
reason: "embedded message failed validation", |
2960
|
|
|
cause: err, |
2961
|
|
|
} |
2962
|
|
|
} |
2963
|
|
|
} |
2964
|
|
|
|
2965
|
|
|
} |
2966
|
|
|
} |
2967
|
|
|
|
2968
|
|
|
if m.GetCursor() != "" { |
2969
|
|
|
|
2970
|
|
|
} |
2971
|
|
|
|
2972
|
|
|
if len(errors) > 0 { |
2973
|
|
|
return PermissionEntityFilterRequestMultiError(errors) |
2974
|
|
|
} |
2975
|
|
|
|
2976
|
|
|
return nil |
2977
|
|
|
} |
2978
|
|
|
|
2979
|
|
|
// PermissionEntityFilterRequestMultiError is an error wrapping multiple |
2980
|
|
|
// validation errors returned by PermissionEntityFilterRequest.ValidateAll() |
2981
|
|
|
// if the designated constraints aren't met. |
2982
|
|
|
type PermissionEntityFilterRequestMultiError []error |
2983
|
|
|
|
2984
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2985
|
|
|
func (m PermissionEntityFilterRequestMultiError) Error() string { |
2986
|
|
|
var msgs []string |
2987
|
|
|
for _, err := range m { |
2988
|
|
|
msgs = append(msgs, err.Error()) |
2989
|
|
|
} |
2990
|
|
|
return strings.Join(msgs, "; ") |
2991
|
|
|
} |
2992
|
|
|
|
2993
|
|
|
// AllErrors returns a list of validation violation errors. |
2994
|
|
|
func (m PermissionEntityFilterRequestMultiError) AllErrors() []error { return m } |
2995
|
|
|
|
2996
|
|
|
// PermissionEntityFilterRequestValidationError is the validation error |
2997
|
|
|
// returned by PermissionEntityFilterRequest.Validate if the designated |
2998
|
|
|
// constraints aren't met. |
2999
|
|
|
type PermissionEntityFilterRequestValidationError struct { |
3000
|
|
|
field string |
3001
|
|
|
reason string |
3002
|
|
|
cause error |
3003
|
|
|
key bool |
3004
|
|
|
} |
3005
|
|
|
|
3006
|
|
|
// Field function returns field value. |
3007
|
|
|
func (e PermissionEntityFilterRequestValidationError) Field() string { return e.field } |
3008
|
|
|
|
3009
|
|
|
// Reason function returns reason value. |
3010
|
|
|
func (e PermissionEntityFilterRequestValidationError) Reason() string { return e.reason } |
3011
|
|
|
|
3012
|
|
|
// Cause function returns cause value. |
3013
|
|
|
func (e PermissionEntityFilterRequestValidationError) Cause() error { return e.cause } |
3014
|
|
|
|
3015
|
|
|
// Key function returns key value. |
3016
|
|
|
func (e PermissionEntityFilterRequestValidationError) Key() bool { return e.key } |
3017
|
|
|
|
3018
|
|
|
// ErrorName returns error name. |
3019
|
|
|
func (e PermissionEntityFilterRequestValidationError) ErrorName() string { |
3020
|
|
|
return "PermissionEntityFilterRequestValidationError" |
3021
|
|
|
} |
3022
|
|
|
|
3023
|
|
|
// Error satisfies the builtin error interface |
3024
|
|
|
func (e PermissionEntityFilterRequestValidationError) Error() string { |
3025
|
|
|
cause := "" |
3026
|
|
|
if e.cause != nil { |
3027
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3028
|
|
|
} |
3029
|
|
|
|
3030
|
|
|
key := "" |
3031
|
|
|
if e.key { |
3032
|
|
|
key = "key for " |
3033
|
|
|
} |
3034
|
|
|
|
3035
|
|
|
return fmt.Sprintf( |
3036
|
|
|
"invalid %sPermissionEntityFilterRequest.%s: %s%s", |
3037
|
|
|
key, |
3038
|
|
|
e.field, |
3039
|
|
|
e.reason, |
3040
|
|
|
cause) |
3041
|
|
|
} |
3042
|
|
|
|
3043
|
|
|
var _ error = PermissionEntityFilterRequestValidationError{} |
3044
|
|
|
|
3045
|
|
|
var _ interface { |
3046
|
|
|
Field() string |
3047
|
|
|
Reason() string |
3048
|
|
|
Key() bool |
3049
|
|
|
Cause() error |
3050
|
|
|
ErrorName() string |
3051
|
|
|
} = PermissionEntityFilterRequestValidationError{} |
3052
|
|
|
|
3053
|
|
|
var _PermissionEntityFilterRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3054
|
|
|
|
3055
|
|
|
// Validate checks the field values on PermissionEntityFilterRequestMetadata |
3056
|
|
|
// with the rules defined in the proto definition for this message. If any |
3057
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
3058
|
|
|
// there are no violations. |
3059
|
|
|
func (m *PermissionEntityFilterRequestMetadata) Validate() error { |
3060
|
|
|
return m.validate(false) |
3061
|
|
|
} |
3062
|
|
|
|
3063
|
|
|
// ValidateAll checks the field values on PermissionEntityFilterRequestMetadata |
3064
|
|
|
// with the rules defined in the proto definition for this message. If any |
3065
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
3066
|
|
|
// PermissionEntityFilterRequestMetadataMultiError, or nil if none found. |
3067
|
|
|
func (m *PermissionEntityFilterRequestMetadata) ValidateAll() error { |
3068
|
|
|
return m.validate(true) |
3069
|
|
|
} |
3070
|
|
|
|
3071
|
|
|
func (m *PermissionEntityFilterRequestMetadata) validate(all bool) error { |
3072
|
|
|
if m == nil { |
3073
|
|
|
return nil |
3074
|
|
|
} |
3075
|
|
|
|
3076
|
|
|
var errors []error |
3077
|
|
|
|
3078
|
|
|
// no validation rules for SchemaVersion |
3079
|
|
|
|
3080
|
|
|
// no validation rules for SnapToken |
3081
|
|
|
|
3082
|
|
|
if m.GetDepth() < 3 { |
3083
|
|
|
err := PermissionEntityFilterRequestMetadataValidationError{ |
3084
|
|
|
field: "Depth", |
3085
|
|
|
reason: "value must be greater than or equal to 3", |
3086
|
|
|
} |
3087
|
|
|
if !all { |
3088
|
|
|
return err |
3089
|
|
|
} |
3090
|
|
|
errors = append(errors, err) |
3091
|
|
|
} |
3092
|
|
|
|
3093
|
|
|
if len(errors) > 0 { |
3094
|
|
|
return PermissionEntityFilterRequestMetadataMultiError(errors) |
3095
|
|
|
} |
3096
|
|
|
|
3097
|
|
|
return nil |
3098
|
|
|
} |
3099
|
|
|
|
3100
|
|
|
// PermissionEntityFilterRequestMetadataMultiError is an error wrapping |
3101
|
|
|
// multiple validation errors returned by |
3102
|
|
|
// PermissionEntityFilterRequestMetadata.ValidateAll() if the designated |
3103
|
|
|
// constraints aren't met. |
3104
|
|
|
type PermissionEntityFilterRequestMetadataMultiError []error |
3105
|
|
|
|
3106
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3107
|
|
|
func (m PermissionEntityFilterRequestMetadataMultiError) Error() string { |
3108
|
|
|
var msgs []string |
3109
|
|
|
for _, err := range m { |
3110
|
|
|
msgs = append(msgs, err.Error()) |
3111
|
|
|
} |
3112
|
|
|
return strings.Join(msgs, "; ") |
3113
|
|
|
} |
3114
|
|
|
|
3115
|
|
|
// AllErrors returns a list of validation violation errors. |
3116
|
|
|
func (m PermissionEntityFilterRequestMetadataMultiError) AllErrors() []error { return m } |
3117
|
|
|
|
3118
|
|
|
// PermissionEntityFilterRequestMetadataValidationError is the validation error |
3119
|
|
|
// returned by PermissionEntityFilterRequestMetadata.Validate if the |
3120
|
|
|
// designated constraints aren't met. |
3121
|
|
|
type PermissionEntityFilterRequestMetadataValidationError struct { |
3122
|
|
|
field string |
3123
|
|
|
reason string |
3124
|
|
|
cause error |
3125
|
|
|
key bool |
3126
|
|
|
} |
3127
|
|
|
|
3128
|
|
|
// Field function returns field value. |
3129
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Field() string { return e.field } |
3130
|
|
|
|
3131
|
|
|
// Reason function returns reason value. |
3132
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Reason() string { return e.reason } |
3133
|
|
|
|
3134
|
|
|
// Cause function returns cause value. |
3135
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Cause() error { return e.cause } |
3136
|
|
|
|
3137
|
|
|
// Key function returns key value. |
3138
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Key() bool { return e.key } |
3139
|
|
|
|
3140
|
|
|
// ErrorName returns error name. |
3141
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) ErrorName() string { |
3142
|
|
|
return "PermissionEntityFilterRequestMetadataValidationError" |
3143
|
|
|
} |
3144
|
|
|
|
3145
|
|
|
// Error satisfies the builtin error interface |
3146
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Error() string { |
3147
|
|
|
cause := "" |
3148
|
|
|
if e.cause != nil { |
3149
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3150
|
|
|
} |
3151
|
|
|
|
3152
|
|
|
key := "" |
3153
|
|
|
if e.key { |
3154
|
|
|
key = "key for " |
3155
|
|
|
} |
3156
|
|
|
|
3157
|
|
|
return fmt.Sprintf( |
3158
|
|
|
"invalid %sPermissionEntityFilterRequestMetadata.%s: %s%s", |
3159
|
|
|
key, |
3160
|
|
|
e.field, |
3161
|
|
|
e.reason, |
3162
|
|
|
cause) |
3163
|
|
|
} |
3164
|
|
|
|
3165
|
|
|
var _ error = PermissionEntityFilterRequestMetadataValidationError{} |
3166
|
|
|
|
3167
|
|
|
var _ interface { |
3168
|
|
|
Field() string |
3169
|
|
|
Reason() string |
3170
|
|
|
Key() bool |
3171
|
|
|
Cause() error |
3172
|
|
|
ErrorName() string |
3173
|
|
|
} = PermissionEntityFilterRequestMetadataValidationError{} |
3174
|
|
|
|
3175
|
|
|
// Validate checks the field values on PermissionLookupSubjectRequest with the |
3176
|
|
|
// rules defined in the proto definition for this message. If any rules are |
3177
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3178
|
|
|
func (m *PermissionLookupSubjectRequest) Validate() error { |
3179
|
|
|
return m.validate(false) |
3180
|
|
|
} |
3181
|
|
|
|
3182
|
|
|
// ValidateAll checks the field values on PermissionLookupSubjectRequest with |
3183
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3184
|
|
|
// are violated, the result is a list of violation errors wrapped in |
3185
|
|
|
// PermissionLookupSubjectRequestMultiError, or nil if none found. |
3186
|
|
|
func (m *PermissionLookupSubjectRequest) ValidateAll() error { |
3187
|
|
|
return m.validate(true) |
3188
|
|
|
} |
3189
|
|
|
|
3190
|
|
|
func (m *PermissionLookupSubjectRequest) validate(all bool) error { |
3191
|
|
|
if m == nil { |
3192
|
|
|
return nil |
3193
|
|
|
} |
3194
|
|
|
|
3195
|
|
|
var errors []error |
3196
|
|
|
|
3197
|
|
|
if len(m.GetTenantId()) > 128 { |
3198
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3199
|
|
|
field: "TenantId", |
3200
|
|
|
reason: "value length must be at most 128 bytes", |
3201
|
|
|
} |
3202
|
|
|
if !all { |
3203
|
|
|
return err |
3204
|
|
|
} |
3205
|
|
|
errors = append(errors, err) |
3206
|
|
|
} |
3207
|
|
|
|
3208
|
|
|
if !_PermissionLookupSubjectRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3209
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3210
|
|
|
field: "TenantId", |
3211
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3212
|
|
|
} |
3213
|
|
|
if !all { |
3214
|
|
|
return err |
3215
|
|
|
} |
3216
|
|
|
errors = append(errors, err) |
3217
|
|
|
} |
3218
|
|
|
|
3219
|
|
|
if m.GetMetadata() == nil { |
3220
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3221
|
|
|
field: "Metadata", |
3222
|
|
|
reason: "value is required", |
3223
|
|
|
} |
3224
|
|
|
if !all { |
3225
|
|
|
return err |
3226
|
|
|
} |
3227
|
|
|
errors = append(errors, err) |
3228
|
|
|
} |
3229
|
|
|
|
3230
|
|
|
if all { |
3231
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
3232
|
|
|
case interface{ ValidateAll() error }: |
3233
|
|
|
if err := v.ValidateAll(); err != nil { |
3234
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3235
|
|
|
field: "Metadata", |
3236
|
|
|
reason: "embedded message failed validation", |
3237
|
|
|
cause: err, |
3238
|
|
|
}) |
3239
|
|
|
} |
3240
|
|
|
case interface{ Validate() error }: |
3241
|
|
|
if err := v.Validate(); err != nil { |
3242
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3243
|
|
|
field: "Metadata", |
3244
|
|
|
reason: "embedded message failed validation", |
3245
|
|
|
cause: err, |
3246
|
|
|
}) |
3247
|
|
|
} |
3248
|
|
|
} |
3249
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
3250
|
|
|
if err := v.Validate(); err != nil { |
3251
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3252
|
|
|
field: "Metadata", |
3253
|
|
|
reason: "embedded message failed validation", |
3254
|
|
|
cause: err, |
3255
|
|
|
} |
3256
|
|
|
} |
3257
|
|
|
} |
3258
|
|
|
|
3259
|
|
|
if m.GetEntity() == nil { |
3260
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3261
|
|
|
field: "Entity", |
3262
|
|
|
reason: "value is required", |
3263
|
|
|
} |
3264
|
|
|
if !all { |
3265
|
|
|
return err |
3266
|
|
|
} |
3267
|
|
|
errors = append(errors, err) |
3268
|
|
|
} |
3269
|
|
|
|
3270
|
|
|
if all { |
3271
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
3272
|
|
|
case interface{ ValidateAll() error }: |
3273
|
|
|
if err := v.ValidateAll(); err != nil { |
3274
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3275
|
|
|
field: "Entity", |
3276
|
|
|
reason: "embedded message failed validation", |
3277
|
|
|
cause: err, |
3278
|
|
|
}) |
3279
|
|
|
} |
3280
|
|
|
case interface{ Validate() error }: |
3281
|
|
|
if err := v.Validate(); err != nil { |
3282
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3283
|
|
|
field: "Entity", |
3284
|
|
|
reason: "embedded message failed validation", |
3285
|
|
|
cause: err, |
3286
|
|
|
}) |
3287
|
|
|
} |
3288
|
|
|
} |
3289
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
3290
|
|
|
if err := v.Validate(); err != nil { |
3291
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3292
|
|
|
field: "Entity", |
3293
|
|
|
reason: "embedded message failed validation", |
3294
|
|
|
cause: err, |
3295
|
|
|
} |
3296
|
|
|
} |
3297
|
|
|
} |
3298
|
|
|
|
3299
|
|
|
if len(m.GetPermission()) > 64 { |
3300
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3301
|
|
|
field: "Permission", |
3302
|
|
|
reason: "value length must be at most 64 bytes", |
3303
|
|
|
} |
3304
|
|
|
if !all { |
3305
|
|
|
return err |
3306
|
|
|
} |
3307
|
|
|
errors = append(errors, err) |
3308
|
|
|
} |
3309
|
|
|
|
3310
|
|
|
if !_PermissionLookupSubjectRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
3311
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3312
|
|
|
field: "Permission", |
3313
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
3314
|
|
|
} |
3315
|
|
|
if !all { |
3316
|
|
|
return err |
3317
|
|
|
} |
3318
|
|
|
errors = append(errors, err) |
3319
|
|
|
} |
3320
|
|
|
|
3321
|
|
|
if m.GetSubjectReference() == nil { |
3322
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3323
|
|
|
field: "SubjectReference", |
3324
|
|
|
reason: "value is required", |
3325
|
|
|
} |
3326
|
|
|
if !all { |
3327
|
|
|
return err |
3328
|
|
|
} |
3329
|
|
|
errors = append(errors, err) |
3330
|
|
|
} |
3331
|
|
|
|
3332
|
|
|
if all { |
3333
|
|
|
switch v := interface{}(m.GetSubjectReference()).(type) { |
3334
|
|
|
case interface{ ValidateAll() error }: |
3335
|
|
|
if err := v.ValidateAll(); err != nil { |
3336
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3337
|
|
|
field: "SubjectReference", |
3338
|
|
|
reason: "embedded message failed validation", |
3339
|
|
|
cause: err, |
3340
|
|
|
}) |
3341
|
|
|
} |
3342
|
|
|
case interface{ Validate() error }: |
3343
|
|
|
if err := v.Validate(); err != nil { |
3344
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3345
|
|
|
field: "SubjectReference", |
3346
|
|
|
reason: "embedded message failed validation", |
3347
|
|
|
cause: err, |
3348
|
|
|
}) |
3349
|
|
|
} |
3350
|
|
|
} |
3351
|
|
|
} else if v, ok := interface{}(m.GetSubjectReference()).(interface{ Validate() error }); ok { |
3352
|
|
|
if err := v.Validate(); err != nil { |
3353
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3354
|
|
|
field: "SubjectReference", |
3355
|
|
|
reason: "embedded message failed validation", |
3356
|
|
|
cause: err, |
3357
|
|
|
} |
3358
|
|
|
} |
3359
|
|
|
} |
3360
|
|
|
|
3361
|
|
|
if all { |
3362
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
3363
|
|
|
case interface{ ValidateAll() error }: |
3364
|
|
|
if err := v.ValidateAll(); err != nil { |
3365
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3366
|
|
|
field: "Context", |
3367
|
|
|
reason: "embedded message failed validation", |
3368
|
|
|
cause: err, |
3369
|
|
|
}) |
3370
|
|
|
} |
3371
|
|
|
case interface{ Validate() error }: |
3372
|
|
|
if err := v.Validate(); err != nil { |
3373
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
3374
|
|
|
field: "Context", |
3375
|
|
|
reason: "embedded message failed validation", |
3376
|
|
|
cause: err, |
3377
|
|
|
}) |
3378
|
|
|
} |
3379
|
|
|
} |
3380
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
3381
|
|
|
if err := v.Validate(); err != nil { |
3382
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
3383
|
|
|
field: "Context", |
3384
|
|
|
reason: "embedded message failed validation", |
3385
|
|
|
cause: err, |
3386
|
|
|
} |
3387
|
|
|
} |
3388
|
|
|
} |
3389
|
|
|
|
3390
|
|
|
if m.GetPageSize() != 0 { |
3391
|
|
|
|
3392
|
|
|
if m.GetPageSize() < 1 { |
3393
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
3394
|
|
|
field: "PageSize", |
3395
|
|
|
reason: "value must be greater than or equal to 1", |
3396
|
|
|
} |
3397
|
|
|
if !all { |
3398
|
|
|
return err |
3399
|
|
|
} |
3400
|
|
|
errors = append(errors, err) |
3401
|
|
|
} |
3402
|
|
|
|
3403
|
|
|
} |
3404
|
|
|
|
3405
|
|
|
if m.GetContinuousToken() != "" { |
3406
|
|
|
|
3407
|
|
|
} |
3408
|
|
|
|
3409
|
|
|
if len(errors) > 0 { |
3410
|
|
|
return PermissionLookupSubjectRequestMultiError(errors) |
3411
|
|
|
} |
3412
|
|
|
|
3413
|
|
|
return nil |
3414
|
|
|
} |
3415
|
|
|
|
3416
|
|
|
// PermissionLookupSubjectRequestMultiError is an error wrapping multiple |
3417
|
|
|
// validation errors returned by PermissionLookupSubjectRequest.ValidateAll() |
3418
|
|
|
// if the designated constraints aren't met. |
3419
|
|
|
type PermissionLookupSubjectRequestMultiError []error |
3420
|
|
|
|
3421
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3422
|
|
|
func (m PermissionLookupSubjectRequestMultiError) Error() string { |
3423
|
|
|
var msgs []string |
3424
|
|
|
for _, err := range m { |
3425
|
|
|
msgs = append(msgs, err.Error()) |
3426
|
|
|
} |
3427
|
|
|
return strings.Join(msgs, "; ") |
3428
|
|
|
} |
3429
|
|
|
|
3430
|
|
|
// AllErrors returns a list of validation violation errors. |
3431
|
|
|
func (m PermissionLookupSubjectRequestMultiError) AllErrors() []error { return m } |
3432
|
|
|
|
3433
|
|
|
// PermissionLookupSubjectRequestValidationError is the validation error |
3434
|
|
|
// returned by PermissionLookupSubjectRequest.Validate if the designated |
3435
|
|
|
// constraints aren't met. |
3436
|
|
|
type PermissionLookupSubjectRequestValidationError struct { |
3437
|
|
|
field string |
3438
|
|
|
reason string |
3439
|
|
|
cause error |
3440
|
|
|
key bool |
3441
|
|
|
} |
3442
|
|
|
|
3443
|
|
|
// Field function returns field value. |
3444
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Field() string { return e.field } |
3445
|
|
|
|
3446
|
|
|
// Reason function returns reason value. |
3447
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Reason() string { return e.reason } |
3448
|
|
|
|
3449
|
|
|
// Cause function returns cause value. |
3450
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Cause() error { return e.cause } |
3451
|
|
|
|
3452
|
|
|
// Key function returns key value. |
3453
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Key() bool { return e.key } |
3454
|
|
|
|
3455
|
|
|
// ErrorName returns error name. |
3456
|
|
|
func (e PermissionLookupSubjectRequestValidationError) ErrorName() string { |
3457
|
|
|
return "PermissionLookupSubjectRequestValidationError" |
3458
|
|
|
} |
3459
|
|
|
|
3460
|
|
|
// Error satisfies the builtin error interface |
3461
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Error() string { |
3462
|
|
|
cause := "" |
3463
|
|
|
if e.cause != nil { |
3464
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3465
|
|
|
} |
3466
|
|
|
|
3467
|
|
|
key := "" |
3468
|
|
|
if e.key { |
3469
|
|
|
key = "key for " |
3470
|
|
|
} |
3471
|
|
|
|
3472
|
|
|
return fmt.Sprintf( |
3473
|
|
|
"invalid %sPermissionLookupSubjectRequest.%s: %s%s", |
3474
|
|
|
key, |
3475
|
|
|
e.field, |
3476
|
|
|
e.reason, |
3477
|
|
|
cause) |
3478
|
|
|
} |
3479
|
|
|
|
3480
|
|
|
var _ error = PermissionLookupSubjectRequestValidationError{} |
3481
|
|
|
|
3482
|
|
|
var _ interface { |
3483
|
|
|
Field() string |
3484
|
|
|
Reason() string |
3485
|
|
|
Key() bool |
3486
|
|
|
Cause() error |
3487
|
|
|
ErrorName() string |
3488
|
|
|
} = PermissionLookupSubjectRequestValidationError{} |
3489
|
|
|
|
3490
|
|
|
var _PermissionLookupSubjectRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3491
|
|
|
|
3492
|
|
|
var _PermissionLookupSubjectRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
3493
|
|
|
|
3494
|
|
|
// Validate checks the field values on PermissionLookupSubjectRequestMetadata |
3495
|
|
|
// with the rules defined in the proto definition for this message. If any |
3496
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
3497
|
|
|
// there are no violations. |
3498
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) Validate() error { |
3499
|
|
|
return m.validate(false) |
3500
|
|
|
} |
3501
|
|
|
|
3502
|
|
|
// ValidateAll checks the field values on |
3503
|
|
|
// PermissionLookupSubjectRequestMetadata with the rules defined in the proto |
3504
|
|
|
// definition for this message. If any rules are violated, the result is a |
3505
|
|
|
// list of violation errors wrapped in |
3506
|
|
|
// PermissionLookupSubjectRequestMetadataMultiError, or nil if none found. |
3507
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) ValidateAll() error { |
3508
|
|
|
return m.validate(true) |
3509
|
|
|
} |
3510
|
|
|
|
3511
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) validate(all bool) error { |
3512
|
|
|
if m == nil { |
3513
|
|
|
return nil |
3514
|
|
|
} |
3515
|
|
|
|
3516
|
|
|
var errors []error |
3517
|
|
|
|
3518
|
|
|
// no validation rules for SchemaVersion |
3519
|
|
|
|
3520
|
|
|
// no validation rules for SnapToken |
3521
|
|
|
|
3522
|
|
|
if m.GetDepth() < 3 { |
3523
|
|
|
err := PermissionLookupSubjectRequestMetadataValidationError{ |
3524
|
|
|
field: "Depth", |
3525
|
|
|
reason: "value must be greater than or equal to 3", |
3526
|
|
|
} |
3527
|
|
|
if !all { |
3528
|
|
|
return err |
3529
|
|
|
} |
3530
|
|
|
errors = append(errors, err) |
3531
|
|
|
} |
3532
|
|
|
|
3533
|
|
|
if len(errors) > 0 { |
3534
|
|
|
return PermissionLookupSubjectRequestMetadataMultiError(errors) |
3535
|
|
|
} |
3536
|
|
|
|
3537
|
|
|
return nil |
3538
|
|
|
} |
3539
|
|
|
|
3540
|
|
|
// PermissionLookupSubjectRequestMetadataMultiError is an error wrapping |
3541
|
|
|
// multiple validation errors returned by |
3542
|
|
|
// PermissionLookupSubjectRequestMetadata.ValidateAll() if the designated |
3543
|
|
|
// constraints aren't met. |
3544
|
|
|
type PermissionLookupSubjectRequestMetadataMultiError []error |
3545
|
|
|
|
3546
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3547
|
|
|
func (m PermissionLookupSubjectRequestMetadataMultiError) Error() string { |
3548
|
|
|
var msgs []string |
3549
|
|
|
for _, err := range m { |
3550
|
|
|
msgs = append(msgs, err.Error()) |
3551
|
|
|
} |
3552
|
|
|
return strings.Join(msgs, "; ") |
3553
|
|
|
} |
3554
|
|
|
|
3555
|
|
|
// AllErrors returns a list of validation violation errors. |
3556
|
|
|
func (m PermissionLookupSubjectRequestMetadataMultiError) AllErrors() []error { return m } |
3557
|
|
|
|
3558
|
|
|
// PermissionLookupSubjectRequestMetadataValidationError is the validation |
3559
|
|
|
// error returned by PermissionLookupSubjectRequestMetadata.Validate if the |
3560
|
|
|
// designated constraints aren't met. |
3561
|
|
|
type PermissionLookupSubjectRequestMetadataValidationError struct { |
3562
|
|
|
field string |
3563
|
|
|
reason string |
3564
|
|
|
cause error |
3565
|
|
|
key bool |
3566
|
|
|
} |
3567
|
|
|
|
3568
|
|
|
// Field function returns field value. |
3569
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Field() string { return e.field } |
3570
|
|
|
|
3571
|
|
|
// Reason function returns reason value. |
3572
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Reason() string { return e.reason } |
3573
|
|
|
|
3574
|
|
|
// Cause function returns cause value. |
3575
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Cause() error { return e.cause } |
3576
|
|
|
|
3577
|
|
|
// Key function returns key value. |
3578
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Key() bool { return e.key } |
3579
|
|
|
|
3580
|
|
|
// ErrorName returns error name. |
3581
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) ErrorName() string { |
3582
|
|
|
return "PermissionLookupSubjectRequestMetadataValidationError" |
3583
|
|
|
} |
3584
|
|
|
|
3585
|
|
|
// Error satisfies the builtin error interface |
3586
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Error() string { |
3587
|
|
|
cause := "" |
3588
|
|
|
if e.cause != nil { |
3589
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3590
|
|
|
} |
3591
|
|
|
|
3592
|
|
|
key := "" |
3593
|
|
|
if e.key { |
3594
|
|
|
key = "key for " |
3595
|
|
|
} |
3596
|
|
|
|
3597
|
|
|
return fmt.Sprintf( |
3598
|
|
|
"invalid %sPermissionLookupSubjectRequestMetadata.%s: %s%s", |
3599
|
|
|
key, |
3600
|
|
|
e.field, |
3601
|
|
|
e.reason, |
3602
|
|
|
cause) |
3603
|
|
|
} |
3604
|
|
|
|
3605
|
|
|
var _ error = PermissionLookupSubjectRequestMetadataValidationError{} |
3606
|
|
|
|
3607
|
|
|
var _ interface { |
3608
|
|
|
Field() string |
3609
|
|
|
Reason() string |
3610
|
|
|
Key() bool |
3611
|
|
|
Cause() error |
3612
|
|
|
ErrorName() string |
3613
|
|
|
} = PermissionLookupSubjectRequestMetadataValidationError{} |
3614
|
|
|
|
3615
|
|
|
// Validate checks the field values on PermissionLookupSubjectResponse with the |
3616
|
|
|
// rules defined in the proto definition for this message. If any rules are |
3617
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3618
|
|
|
func (m *PermissionLookupSubjectResponse) Validate() error { |
3619
|
|
|
return m.validate(false) |
3620
|
|
|
} |
3621
|
|
|
|
3622
|
|
|
// ValidateAll checks the field values on PermissionLookupSubjectResponse with |
3623
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3624
|
|
|
// are violated, the result is a list of violation errors wrapped in |
3625
|
|
|
// PermissionLookupSubjectResponseMultiError, or nil if none found. |
3626
|
|
|
func (m *PermissionLookupSubjectResponse) ValidateAll() error { |
3627
|
|
|
return m.validate(true) |
3628
|
|
|
} |
3629
|
|
|
|
3630
|
|
|
func (m *PermissionLookupSubjectResponse) validate(all bool) error { |
3631
|
|
|
if m == nil { |
3632
|
|
|
return nil |
3633
|
|
|
} |
3634
|
|
|
|
3635
|
|
|
var errors []error |
3636
|
|
|
|
3637
|
|
|
// no validation rules for ContinuousToken |
3638
|
|
|
|
3639
|
|
|
if len(errors) > 0 { |
3640
|
|
|
return PermissionLookupSubjectResponseMultiError(errors) |
3641
|
|
|
} |
3642
|
|
|
|
3643
|
|
|
return nil |
3644
|
|
|
} |
3645
|
|
|
|
3646
|
|
|
// PermissionLookupSubjectResponseMultiError is an error wrapping multiple |
3647
|
|
|
// validation errors returned by PermissionLookupSubjectResponse.ValidateAll() |
3648
|
|
|
// if the designated constraints aren't met. |
3649
|
|
|
type PermissionLookupSubjectResponseMultiError []error |
3650
|
|
|
|
3651
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3652
|
|
|
func (m PermissionLookupSubjectResponseMultiError) Error() string { |
3653
|
|
|
var msgs []string |
3654
|
|
|
for _, err := range m { |
3655
|
|
|
msgs = append(msgs, err.Error()) |
3656
|
|
|
} |
3657
|
|
|
return strings.Join(msgs, "; ") |
3658
|
|
|
} |
3659
|
|
|
|
3660
|
|
|
// AllErrors returns a list of validation violation errors. |
3661
|
|
|
func (m PermissionLookupSubjectResponseMultiError) AllErrors() []error { return m } |
3662
|
|
|
|
3663
|
|
|
// PermissionLookupSubjectResponseValidationError is the validation error |
3664
|
|
|
// returned by PermissionLookupSubjectResponse.Validate if the designated |
3665
|
|
|
// constraints aren't met. |
3666
|
|
|
type PermissionLookupSubjectResponseValidationError struct { |
3667
|
|
|
field string |
3668
|
|
|
reason string |
3669
|
|
|
cause error |
3670
|
|
|
key bool |
3671
|
|
|
} |
3672
|
|
|
|
3673
|
|
|
// Field function returns field value. |
3674
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Field() string { return e.field } |
3675
|
|
|
|
3676
|
|
|
// Reason function returns reason value. |
3677
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Reason() string { return e.reason } |
3678
|
|
|
|
3679
|
|
|
// Cause function returns cause value. |
3680
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Cause() error { return e.cause } |
3681
|
|
|
|
3682
|
|
|
// Key function returns key value. |
3683
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Key() bool { return e.key } |
3684
|
|
|
|
3685
|
|
|
// ErrorName returns error name. |
3686
|
|
|
func (e PermissionLookupSubjectResponseValidationError) ErrorName() string { |
3687
|
|
|
return "PermissionLookupSubjectResponseValidationError" |
3688
|
|
|
} |
3689
|
|
|
|
3690
|
|
|
// Error satisfies the builtin error interface |
3691
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Error() string { |
3692
|
|
|
cause := "" |
3693
|
|
|
if e.cause != nil { |
3694
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3695
|
|
|
} |
3696
|
|
|
|
3697
|
|
|
key := "" |
3698
|
|
|
if e.key { |
3699
|
|
|
key = "key for " |
3700
|
|
|
} |
3701
|
|
|
|
3702
|
|
|
return fmt.Sprintf( |
3703
|
|
|
"invalid %sPermissionLookupSubjectResponse.%s: %s%s", |
3704
|
|
|
key, |
3705
|
|
|
e.field, |
3706
|
|
|
e.reason, |
3707
|
|
|
cause) |
3708
|
|
|
} |
3709
|
|
|
|
3710
|
|
|
var _ error = PermissionLookupSubjectResponseValidationError{} |
3711
|
|
|
|
3712
|
|
|
var _ interface { |
3713
|
|
|
Field() string |
3714
|
|
|
Reason() string |
3715
|
|
|
Key() bool |
3716
|
|
|
Cause() error |
3717
|
|
|
ErrorName() string |
3718
|
|
|
} = PermissionLookupSubjectResponseValidationError{} |
3719
|
|
|
|
3720
|
|
|
// Validate checks the field values on PermissionSubjectPermissionRequest with |
3721
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3722
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
3723
|
|
|
// no violations. |
3724
|
|
|
func (m *PermissionSubjectPermissionRequest) Validate() error { |
3725
|
|
|
return m.validate(false) |
3726
|
|
|
} |
3727
|
|
|
|
3728
|
|
|
// ValidateAll checks the field values on PermissionSubjectPermissionRequest |
3729
|
|
|
// with the rules defined in the proto definition for this message. If any |
3730
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
3731
|
|
|
// PermissionSubjectPermissionRequestMultiError, or nil if none found. |
3732
|
|
|
func (m *PermissionSubjectPermissionRequest) ValidateAll() error { |
3733
|
|
|
return m.validate(true) |
3734
|
|
|
} |
3735
|
|
|
|
3736
|
|
|
func (m *PermissionSubjectPermissionRequest) validate(all bool) error { |
3737
|
|
|
if m == nil { |
3738
|
|
|
return nil |
3739
|
|
|
} |
3740
|
|
|
|
3741
|
|
|
var errors []error |
3742
|
|
|
|
3743
|
|
|
if len(m.GetTenantId()) > 128 { |
3744
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3745
|
|
|
field: "TenantId", |
3746
|
|
|
reason: "value length must be at most 128 bytes", |
3747
|
|
|
} |
3748
|
|
|
if !all { |
3749
|
|
|
return err |
3750
|
|
|
} |
3751
|
|
|
errors = append(errors, err) |
3752
|
|
|
} |
3753
|
|
|
|
3754
|
|
|
if !_PermissionSubjectPermissionRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3755
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3756
|
|
|
field: "TenantId", |
3757
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3758
|
|
|
} |
3759
|
|
|
if !all { |
3760
|
|
|
return err |
3761
|
|
|
} |
3762
|
|
|
errors = append(errors, err) |
3763
|
|
|
} |
3764
|
|
|
|
3765
|
|
|
if m.GetMetadata() == nil { |
3766
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3767
|
|
|
field: "Metadata", |
3768
|
|
|
reason: "value is required", |
3769
|
|
|
} |
3770
|
|
|
if !all { |
3771
|
|
|
return err |
3772
|
|
|
} |
3773
|
|
|
errors = append(errors, err) |
3774
|
|
|
} |
3775
|
|
|
|
3776
|
|
|
if all { |
3777
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
3778
|
|
|
case interface{ ValidateAll() error }: |
3779
|
|
|
if err := v.ValidateAll(); err != nil { |
3780
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3781
|
|
|
field: "Metadata", |
3782
|
|
|
reason: "embedded message failed validation", |
3783
|
|
|
cause: err, |
3784
|
|
|
}) |
3785
|
|
|
} |
3786
|
|
|
case interface{ Validate() error }: |
3787
|
|
|
if err := v.Validate(); err != nil { |
3788
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3789
|
|
|
field: "Metadata", |
3790
|
|
|
reason: "embedded message failed validation", |
3791
|
|
|
cause: err, |
3792
|
|
|
}) |
3793
|
|
|
} |
3794
|
|
|
} |
3795
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
3796
|
|
|
if err := v.Validate(); err != nil { |
3797
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3798
|
|
|
field: "Metadata", |
3799
|
|
|
reason: "embedded message failed validation", |
3800
|
|
|
cause: err, |
3801
|
|
|
} |
3802
|
|
|
} |
3803
|
|
|
} |
3804
|
|
|
|
3805
|
|
|
if m.GetEntity() == nil { |
3806
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3807
|
|
|
field: "Entity", |
3808
|
|
|
reason: "value is required", |
3809
|
|
|
} |
3810
|
|
|
if !all { |
3811
|
|
|
return err |
3812
|
|
|
} |
3813
|
|
|
errors = append(errors, err) |
3814
|
|
|
} |
3815
|
|
|
|
3816
|
|
|
if all { |
3817
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
3818
|
|
|
case interface{ ValidateAll() error }: |
3819
|
|
|
if err := v.ValidateAll(); err != nil { |
3820
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3821
|
|
|
field: "Entity", |
3822
|
|
|
reason: "embedded message failed validation", |
3823
|
|
|
cause: err, |
3824
|
|
|
}) |
3825
|
|
|
} |
3826
|
|
|
case interface{ Validate() error }: |
3827
|
|
|
if err := v.Validate(); err != nil { |
3828
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3829
|
|
|
field: "Entity", |
3830
|
|
|
reason: "embedded message failed validation", |
3831
|
|
|
cause: err, |
3832
|
|
|
}) |
3833
|
|
|
} |
3834
|
|
|
} |
3835
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
3836
|
|
|
if err := v.Validate(); err != nil { |
3837
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3838
|
|
|
field: "Entity", |
3839
|
|
|
reason: "embedded message failed validation", |
3840
|
|
|
cause: err, |
3841
|
|
|
} |
3842
|
|
|
} |
3843
|
|
|
} |
3844
|
|
|
|
3845
|
|
|
if m.GetSubject() == nil { |
3846
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3847
|
|
|
field: "Subject", |
3848
|
|
|
reason: "value is required", |
3849
|
|
|
} |
3850
|
|
|
if !all { |
3851
|
|
|
return err |
3852
|
|
|
} |
3853
|
|
|
errors = append(errors, err) |
3854
|
|
|
} |
3855
|
|
|
|
3856
|
|
|
if all { |
3857
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
3858
|
|
|
case interface{ ValidateAll() error }: |
3859
|
|
|
if err := v.ValidateAll(); err != nil { |
3860
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3861
|
|
|
field: "Subject", |
3862
|
|
|
reason: "embedded message failed validation", |
3863
|
|
|
cause: err, |
3864
|
|
|
}) |
3865
|
|
|
} |
3866
|
|
|
case interface{ Validate() error }: |
3867
|
|
|
if err := v.Validate(); err != nil { |
3868
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3869
|
|
|
field: "Subject", |
3870
|
|
|
reason: "embedded message failed validation", |
3871
|
|
|
cause: err, |
3872
|
|
|
}) |
3873
|
|
|
} |
3874
|
|
|
} |
3875
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
3876
|
|
|
if err := v.Validate(); err != nil { |
3877
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3878
|
|
|
field: "Subject", |
3879
|
|
|
reason: "embedded message failed validation", |
3880
|
|
|
cause: err, |
3881
|
|
|
} |
3882
|
|
|
} |
3883
|
|
|
} |
3884
|
|
|
|
3885
|
|
|
if all { |
3886
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
3887
|
|
|
case interface{ ValidateAll() error }: |
3888
|
|
|
if err := v.ValidateAll(); err != nil { |
3889
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3890
|
|
|
field: "Context", |
3891
|
|
|
reason: "embedded message failed validation", |
3892
|
|
|
cause: err, |
3893
|
|
|
}) |
3894
|
|
|
} |
3895
|
|
|
case interface{ Validate() error }: |
3896
|
|
|
if err := v.Validate(); err != nil { |
3897
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3898
|
|
|
field: "Context", |
3899
|
|
|
reason: "embedded message failed validation", |
3900
|
|
|
cause: err, |
3901
|
|
|
}) |
3902
|
|
|
} |
3903
|
|
|
} |
3904
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
3905
|
|
|
if err := v.Validate(); err != nil { |
3906
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3907
|
|
|
field: "Context", |
3908
|
|
|
reason: "embedded message failed validation", |
3909
|
|
|
cause: err, |
3910
|
|
|
} |
3911
|
|
|
} |
3912
|
|
|
} |
3913
|
|
|
|
3914
|
|
|
if len(errors) > 0 { |
3915
|
|
|
return PermissionSubjectPermissionRequestMultiError(errors) |
3916
|
|
|
} |
3917
|
|
|
|
3918
|
|
|
return nil |
3919
|
|
|
} |
3920
|
|
|
|
3921
|
|
|
// PermissionSubjectPermissionRequestMultiError is an error wrapping multiple |
3922
|
|
|
// validation errors returned by |
3923
|
|
|
// PermissionSubjectPermissionRequest.ValidateAll() if the designated |
3924
|
|
|
// constraints aren't met. |
3925
|
|
|
type PermissionSubjectPermissionRequestMultiError []error |
3926
|
|
|
|
3927
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3928
|
|
|
func (m PermissionSubjectPermissionRequestMultiError) Error() string { |
3929
|
|
|
var msgs []string |
3930
|
|
|
for _, err := range m { |
3931
|
|
|
msgs = append(msgs, err.Error()) |
3932
|
|
|
} |
3933
|
|
|
return strings.Join(msgs, "; ") |
3934
|
|
|
} |
3935
|
|
|
|
3936
|
|
|
// AllErrors returns a list of validation violation errors. |
3937
|
|
|
func (m PermissionSubjectPermissionRequestMultiError) AllErrors() []error { return m } |
3938
|
|
|
|
3939
|
|
|
// PermissionSubjectPermissionRequestValidationError is the validation error |
3940
|
|
|
// returned by PermissionSubjectPermissionRequest.Validate if the designated |
3941
|
|
|
// constraints aren't met. |
3942
|
|
|
type PermissionSubjectPermissionRequestValidationError struct { |
3943
|
|
|
field string |
3944
|
|
|
reason string |
3945
|
|
|
cause error |
3946
|
|
|
key bool |
3947
|
|
|
} |
3948
|
|
|
|
3949
|
|
|
// Field function returns field value. |
3950
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Field() string { return e.field } |
3951
|
|
|
|
3952
|
|
|
// Reason function returns reason value. |
3953
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Reason() string { return e.reason } |
3954
|
|
|
|
3955
|
|
|
// Cause function returns cause value. |
3956
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Cause() error { return e.cause } |
3957
|
|
|
|
3958
|
|
|
// Key function returns key value. |
3959
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Key() bool { return e.key } |
3960
|
|
|
|
3961
|
|
|
// ErrorName returns error name. |
3962
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) ErrorName() string { |
3963
|
|
|
return "PermissionSubjectPermissionRequestValidationError" |
3964
|
|
|
} |
3965
|
|
|
|
3966
|
|
|
// Error satisfies the builtin error interface |
3967
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Error() string { |
3968
|
|
|
cause := "" |
3969
|
|
|
if e.cause != nil { |
3970
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3971
|
|
|
} |
3972
|
|
|
|
3973
|
|
|
key := "" |
3974
|
|
|
if e.key { |
3975
|
|
|
key = "key for " |
3976
|
|
|
} |
3977
|
|
|
|
3978
|
|
|
return fmt.Sprintf( |
3979
|
|
|
"invalid %sPermissionSubjectPermissionRequest.%s: %s%s", |
3980
|
|
|
key, |
3981
|
|
|
e.field, |
3982
|
|
|
e.reason, |
3983
|
|
|
cause) |
3984
|
|
|
} |
3985
|
|
|
|
3986
|
|
|
var _ error = PermissionSubjectPermissionRequestValidationError{} |
3987
|
|
|
|
3988
|
|
|
var _ interface { |
3989
|
|
|
Field() string |
3990
|
|
|
Reason() string |
3991
|
|
|
Key() bool |
3992
|
|
|
Cause() error |
3993
|
|
|
ErrorName() string |
3994
|
|
|
} = PermissionSubjectPermissionRequestValidationError{} |
3995
|
|
|
|
3996
|
|
|
var _PermissionSubjectPermissionRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3997
|
|
|
|
3998
|
|
|
// Validate checks the field values on |
3999
|
|
|
// PermissionSubjectPermissionRequestMetadata with the rules defined in the |
4000
|
|
|
// proto definition for this message. If any rules are violated, the first |
4001
|
|
|
// error encountered is returned, or nil if there are no violations. |
4002
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) Validate() error { |
4003
|
|
|
return m.validate(false) |
4004
|
|
|
} |
4005
|
|
|
|
4006
|
|
|
// ValidateAll checks the field values on |
4007
|
|
|
// PermissionSubjectPermissionRequestMetadata with the rules defined in the |
4008
|
|
|
// proto definition for this message. If any rules are violated, the result is |
4009
|
|
|
// a list of violation errors wrapped in |
4010
|
|
|
// PermissionSubjectPermissionRequestMetadataMultiError, or nil if none found. |
4011
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) ValidateAll() error { |
4012
|
|
|
return m.validate(true) |
4013
|
|
|
} |
4014
|
|
|
|
4015
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) validate(all bool) error { |
4016
|
|
|
if m == nil { |
4017
|
|
|
return nil |
4018
|
|
|
} |
4019
|
|
|
|
4020
|
|
|
var errors []error |
4021
|
|
|
|
4022
|
|
|
// no validation rules for SchemaVersion |
4023
|
|
|
|
4024
|
|
|
// no validation rules for SnapToken |
4025
|
|
|
|
4026
|
|
|
// no validation rules for OnlyPermission |
4027
|
|
|
|
4028
|
|
|
if m.GetDepth() < 3 { |
4029
|
|
|
err := PermissionSubjectPermissionRequestMetadataValidationError{ |
4030
|
|
|
field: "Depth", |
4031
|
|
|
reason: "value must be greater than or equal to 3", |
4032
|
|
|
} |
4033
|
|
|
if !all { |
4034
|
|
|
return err |
4035
|
|
|
} |
4036
|
|
|
errors = append(errors, err) |
4037
|
|
|
} |
4038
|
|
|
|
4039
|
|
|
if len(errors) > 0 { |
4040
|
|
|
return PermissionSubjectPermissionRequestMetadataMultiError(errors) |
4041
|
|
|
} |
4042
|
|
|
|
4043
|
|
|
return nil |
4044
|
|
|
} |
4045
|
|
|
|
4046
|
|
|
// PermissionSubjectPermissionRequestMetadataMultiError is an error wrapping |
4047
|
|
|
// multiple validation errors returned by |
4048
|
|
|
// PermissionSubjectPermissionRequestMetadata.ValidateAll() if the designated |
4049
|
|
|
// constraints aren't met. |
4050
|
|
|
type PermissionSubjectPermissionRequestMetadataMultiError []error |
4051
|
|
|
|
4052
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4053
|
|
|
func (m PermissionSubjectPermissionRequestMetadataMultiError) Error() string { |
4054
|
|
|
var msgs []string |
4055
|
|
|
for _, err := range m { |
4056
|
|
|
msgs = append(msgs, err.Error()) |
4057
|
|
|
} |
4058
|
|
|
return strings.Join(msgs, "; ") |
4059
|
|
|
} |
4060
|
|
|
|
4061
|
|
|
// AllErrors returns a list of validation violation errors. |
4062
|
|
|
func (m PermissionSubjectPermissionRequestMetadataMultiError) AllErrors() []error { return m } |
4063
|
|
|
|
4064
|
|
|
// PermissionSubjectPermissionRequestMetadataValidationError is the validation |
4065
|
|
|
// error returned by PermissionSubjectPermissionRequestMetadata.Validate if |
4066
|
|
|
// the designated constraints aren't met. |
4067
|
|
|
type PermissionSubjectPermissionRequestMetadataValidationError struct { |
4068
|
|
|
field string |
4069
|
|
|
reason string |
4070
|
|
|
cause error |
4071
|
|
|
key bool |
4072
|
|
|
} |
4073
|
|
|
|
4074
|
|
|
// Field function returns field value. |
4075
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Field() string { return e.field } |
4076
|
|
|
|
4077
|
|
|
// Reason function returns reason value. |
4078
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Reason() string { return e.reason } |
4079
|
|
|
|
4080
|
|
|
// Cause function returns cause value. |
4081
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Cause() error { return e.cause } |
4082
|
|
|
|
4083
|
|
|
// Key function returns key value. |
4084
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Key() bool { return e.key } |
4085
|
|
|
|
4086
|
|
|
// ErrorName returns error name. |
4087
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) ErrorName() string { |
4088
|
|
|
return "PermissionSubjectPermissionRequestMetadataValidationError" |
4089
|
|
|
} |
4090
|
|
|
|
4091
|
|
|
// Error satisfies the builtin error interface |
4092
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Error() string { |
4093
|
|
|
cause := "" |
4094
|
|
|
if e.cause != nil { |
4095
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4096
|
|
|
} |
4097
|
|
|
|
4098
|
|
|
key := "" |
4099
|
|
|
if e.key { |
4100
|
|
|
key = "key for " |
4101
|
|
|
} |
4102
|
|
|
|
4103
|
|
|
return fmt.Sprintf( |
4104
|
|
|
"invalid %sPermissionSubjectPermissionRequestMetadata.%s: %s%s", |
4105
|
|
|
key, |
4106
|
|
|
e.field, |
4107
|
|
|
e.reason, |
4108
|
|
|
cause) |
4109
|
|
|
} |
4110
|
|
|
|
4111
|
|
|
var _ error = PermissionSubjectPermissionRequestMetadataValidationError{} |
4112
|
|
|
|
4113
|
|
|
var _ interface { |
4114
|
|
|
Field() string |
4115
|
|
|
Reason() string |
4116
|
|
|
Key() bool |
4117
|
|
|
Cause() error |
4118
|
|
|
ErrorName() string |
4119
|
|
|
} = PermissionSubjectPermissionRequestMetadataValidationError{} |
4120
|
|
|
|
4121
|
|
|
// Validate checks the field values on PermissionSubjectPermissionResponse with |
4122
|
|
|
// the rules defined in the proto definition for this message. If any rules |
4123
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
4124
|
|
|
// no violations. |
4125
|
|
|
func (m *PermissionSubjectPermissionResponse) Validate() error { |
4126
|
|
|
return m.validate(false) |
4127
|
|
|
} |
4128
|
|
|
|
4129
|
|
|
// ValidateAll checks the field values on PermissionSubjectPermissionResponse |
4130
|
|
|
// with the rules defined in the proto definition for this message. If any |
4131
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
4132
|
|
|
// PermissionSubjectPermissionResponseMultiError, or nil if none found. |
4133
|
|
|
func (m *PermissionSubjectPermissionResponse) ValidateAll() error { |
4134
|
|
|
return m.validate(true) |
4135
|
|
|
} |
4136
|
|
|
|
4137
|
|
|
func (m *PermissionSubjectPermissionResponse) validate(all bool) error { |
4138
|
|
|
if m == nil { |
4139
|
|
|
return nil |
4140
|
|
|
} |
4141
|
|
|
|
4142
|
|
|
var errors []error |
4143
|
|
|
|
4144
|
|
|
// no validation rules for Results |
4145
|
|
|
|
4146
|
|
|
if len(errors) > 0 { |
4147
|
|
|
return PermissionSubjectPermissionResponseMultiError(errors) |
4148
|
|
|
} |
4149
|
|
|
|
4150
|
|
|
return nil |
4151
|
|
|
} |
4152
|
|
|
|
4153
|
|
|
// PermissionSubjectPermissionResponseMultiError is an error wrapping multiple |
4154
|
|
|
// validation errors returned by |
4155
|
|
|
// PermissionSubjectPermissionResponse.ValidateAll() if the designated |
4156
|
|
|
// constraints aren't met. |
4157
|
|
|
type PermissionSubjectPermissionResponseMultiError []error |
4158
|
|
|
|
4159
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4160
|
|
|
func (m PermissionSubjectPermissionResponseMultiError) Error() string { |
4161
|
|
|
var msgs []string |
4162
|
|
|
for _, err := range m { |
4163
|
|
|
msgs = append(msgs, err.Error()) |
4164
|
|
|
} |
4165
|
|
|
return strings.Join(msgs, "; ") |
4166
|
|
|
} |
4167
|
|
|
|
4168
|
|
|
// AllErrors returns a list of validation violation errors. |
4169
|
|
|
func (m PermissionSubjectPermissionResponseMultiError) AllErrors() []error { return m } |
4170
|
|
|
|
4171
|
|
|
// PermissionSubjectPermissionResponseValidationError is the validation error |
4172
|
|
|
// returned by PermissionSubjectPermissionResponse.Validate if the designated |
4173
|
|
|
// constraints aren't met. |
4174
|
|
|
type PermissionSubjectPermissionResponseValidationError struct { |
4175
|
|
|
field string |
4176
|
|
|
reason string |
4177
|
|
|
cause error |
4178
|
|
|
key bool |
4179
|
|
|
} |
4180
|
|
|
|
4181
|
|
|
// Field function returns field value. |
4182
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Field() string { return e.field } |
4183
|
|
|
|
4184
|
|
|
// Reason function returns reason value. |
4185
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Reason() string { return e.reason } |
4186
|
|
|
|
4187
|
|
|
// Cause function returns cause value. |
4188
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Cause() error { return e.cause } |
4189
|
|
|
|
4190
|
|
|
// Key function returns key value. |
4191
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Key() bool { return e.key } |
4192
|
|
|
|
4193
|
|
|
// ErrorName returns error name. |
4194
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) ErrorName() string { |
4195
|
|
|
return "PermissionSubjectPermissionResponseValidationError" |
4196
|
|
|
} |
4197
|
|
|
|
4198
|
|
|
// Error satisfies the builtin error interface |
4199
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Error() string { |
4200
|
|
|
cause := "" |
4201
|
|
|
if e.cause != nil { |
4202
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4203
|
|
|
} |
4204
|
|
|
|
4205
|
|
|
key := "" |
4206
|
|
|
if e.key { |
4207
|
|
|
key = "key for " |
4208
|
|
|
} |
4209
|
|
|
|
4210
|
|
|
return fmt.Sprintf( |
4211
|
|
|
"invalid %sPermissionSubjectPermissionResponse.%s: %s%s", |
4212
|
|
|
key, |
4213
|
|
|
e.field, |
4214
|
|
|
e.reason, |
4215
|
|
|
cause) |
4216
|
|
|
} |
4217
|
|
|
|
4218
|
|
|
var _ error = PermissionSubjectPermissionResponseValidationError{} |
4219
|
|
|
|
4220
|
|
|
var _ interface { |
4221
|
|
|
Field() string |
4222
|
|
|
Reason() string |
4223
|
|
|
Key() bool |
4224
|
|
|
Cause() error |
4225
|
|
|
ErrorName() string |
4226
|
|
|
} = PermissionSubjectPermissionResponseValidationError{} |
4227
|
|
|
|
4228
|
|
|
// Validate checks the field values on WatchRequest with the rules defined in |
4229
|
|
|
// the proto definition for this message. If any rules are violated, the first |
4230
|
|
|
// error encountered is returned, or nil if there are no violations. |
4231
|
|
|
func (m *WatchRequest) Validate() error { |
4232
|
|
|
return m.validate(false) |
4233
|
|
|
} |
4234
|
|
|
|
4235
|
|
|
// ValidateAll checks the field values on WatchRequest with the rules defined |
4236
|
|
|
// in the proto definition for this message. If any rules are violated, the |
4237
|
|
|
// result is a list of violation errors wrapped in WatchRequestMultiError, or |
4238
|
|
|
// nil if none found. |
4239
|
|
|
func (m *WatchRequest) ValidateAll() error { |
4240
|
|
|
return m.validate(true) |
4241
|
|
|
} |
4242
|
|
|
|
4243
|
|
|
func (m *WatchRequest) validate(all bool) error { |
4244
|
|
|
if m == nil { |
4245
|
|
|
return nil |
4246
|
|
|
} |
4247
|
|
|
|
4248
|
|
|
var errors []error |
4249
|
|
|
|
4250
|
|
|
if len(m.GetTenantId()) > 128 { |
4251
|
|
|
err := WatchRequestValidationError{ |
4252
|
|
|
field: "TenantId", |
4253
|
|
|
reason: "value length must be at most 128 bytes", |
4254
|
|
|
} |
4255
|
|
|
if !all { |
4256
|
|
|
return err |
4257
|
|
|
} |
4258
|
|
|
errors = append(errors, err) |
4259
|
|
|
} |
4260
|
|
|
|
4261
|
|
|
if !_WatchRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4262
|
|
|
err := WatchRequestValidationError{ |
4263
|
|
|
field: "TenantId", |
4264
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4265
|
|
|
} |
4266
|
|
|
if !all { |
4267
|
|
|
return err |
4268
|
|
|
} |
4269
|
|
|
errors = append(errors, err) |
4270
|
|
|
} |
4271
|
|
|
|
4272
|
|
|
// no validation rules for SnapToken |
4273
|
|
|
|
4274
|
|
|
if len(errors) > 0 { |
4275
|
|
|
return WatchRequestMultiError(errors) |
4276
|
|
|
} |
4277
|
|
|
|
4278
|
|
|
return nil |
4279
|
|
|
} |
4280
|
|
|
|
4281
|
|
|
// WatchRequestMultiError is an error wrapping multiple validation errors |
4282
|
|
|
// returned by WatchRequest.ValidateAll() if the designated constraints aren't met. |
4283
|
|
|
type WatchRequestMultiError []error |
4284
|
|
|
|
4285
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4286
|
|
|
func (m WatchRequestMultiError) Error() string { |
4287
|
|
|
var msgs []string |
4288
|
|
|
for _, err := range m { |
4289
|
|
|
msgs = append(msgs, err.Error()) |
4290
|
|
|
} |
4291
|
|
|
return strings.Join(msgs, "; ") |
4292
|
|
|
} |
4293
|
|
|
|
4294
|
|
|
// AllErrors returns a list of validation violation errors. |
4295
|
|
|
func (m WatchRequestMultiError) AllErrors() []error { return m } |
4296
|
|
|
|
4297
|
|
|
// WatchRequestValidationError is the validation error returned by |
4298
|
|
|
// WatchRequest.Validate if the designated constraints aren't met. |
4299
|
|
|
type WatchRequestValidationError struct { |
4300
|
|
|
field string |
4301
|
|
|
reason string |
4302
|
|
|
cause error |
4303
|
|
|
key bool |
4304
|
|
|
} |
4305
|
|
|
|
4306
|
|
|
// Field function returns field value. |
4307
|
|
|
func (e WatchRequestValidationError) Field() string { return e.field } |
4308
|
|
|
|
4309
|
|
|
// Reason function returns reason value. |
4310
|
|
|
func (e WatchRequestValidationError) Reason() string { return e.reason } |
4311
|
|
|
|
4312
|
|
|
// Cause function returns cause value. |
4313
|
|
|
func (e WatchRequestValidationError) Cause() error { return e.cause } |
4314
|
|
|
|
4315
|
|
|
// Key function returns key value. |
4316
|
|
|
func (e WatchRequestValidationError) Key() bool { return e.key } |
4317
|
|
|
|
4318
|
|
|
// ErrorName returns error name. |
4319
|
|
|
func (e WatchRequestValidationError) ErrorName() string { return "WatchRequestValidationError" } |
4320
|
|
|
|
4321
|
|
|
// Error satisfies the builtin error interface |
4322
|
|
|
func (e WatchRequestValidationError) Error() string { |
4323
|
|
|
cause := "" |
4324
|
|
|
if e.cause != nil { |
4325
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4326
|
|
|
} |
4327
|
|
|
|
4328
|
|
|
key := "" |
4329
|
|
|
if e.key { |
4330
|
|
|
key = "key for " |
4331
|
|
|
} |
4332
|
|
|
|
4333
|
|
|
return fmt.Sprintf( |
4334
|
|
|
"invalid %sWatchRequest.%s: %s%s", |
4335
|
|
|
key, |
4336
|
|
|
e.field, |
4337
|
|
|
e.reason, |
4338
|
|
|
cause) |
4339
|
|
|
} |
4340
|
|
|
|
4341
|
|
|
var _ error = WatchRequestValidationError{} |
4342
|
|
|
|
4343
|
|
|
var _ interface { |
4344
|
|
|
Field() string |
4345
|
|
|
Reason() string |
4346
|
|
|
Key() bool |
4347
|
|
|
Cause() error |
4348
|
|
|
ErrorName() string |
4349
|
|
|
} = WatchRequestValidationError{} |
4350
|
|
|
|
4351
|
|
|
var _WatchRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4352
|
|
|
|
4353
|
|
|
// Validate checks the field values on WatchResponse with the rules defined in |
4354
|
|
|
// the proto definition for this message. If any rules are violated, the first |
4355
|
|
|
// error encountered is returned, or nil if there are no violations. |
4356
|
|
|
func (m *WatchResponse) Validate() error { |
4357
|
|
|
return m.validate(false) |
4358
|
|
|
} |
4359
|
|
|
|
4360
|
|
|
// ValidateAll checks the field values on WatchResponse with the rules defined |
4361
|
|
|
// in the proto definition for this message. If any rules are violated, the |
4362
|
|
|
// result is a list of violation errors wrapped in WatchResponseMultiError, or |
4363
|
|
|
// nil if none found. |
4364
|
|
|
func (m *WatchResponse) ValidateAll() error { |
4365
|
|
|
return m.validate(true) |
4366
|
|
|
} |
4367
|
|
|
|
4368
|
|
|
func (m *WatchResponse) validate(all bool) error { |
4369
|
|
|
if m == nil { |
4370
|
|
|
return nil |
4371
|
|
|
} |
4372
|
|
|
|
4373
|
|
|
var errors []error |
4374
|
|
|
|
4375
|
|
|
if all { |
4376
|
|
|
switch v := interface{}(m.GetChanges()).(type) { |
4377
|
|
|
case interface{ ValidateAll() error }: |
4378
|
|
|
if err := v.ValidateAll(); err != nil { |
4379
|
|
|
errors = append(errors, WatchResponseValidationError{ |
4380
|
|
|
field: "Changes", |
4381
|
|
|
reason: "embedded message failed validation", |
4382
|
|
|
cause: err, |
4383
|
|
|
}) |
4384
|
|
|
} |
4385
|
|
|
case interface{ Validate() error }: |
4386
|
|
|
if err := v.Validate(); err != nil { |
4387
|
|
|
errors = append(errors, WatchResponseValidationError{ |
4388
|
|
|
field: "Changes", |
4389
|
|
|
reason: "embedded message failed validation", |
4390
|
|
|
cause: err, |
4391
|
|
|
}) |
4392
|
|
|
} |
4393
|
|
|
} |
4394
|
|
|
} else if v, ok := interface{}(m.GetChanges()).(interface{ Validate() error }); ok { |
4395
|
|
|
if err := v.Validate(); err != nil { |
4396
|
|
|
return WatchResponseValidationError{ |
4397
|
|
|
field: "Changes", |
4398
|
|
|
reason: "embedded message failed validation", |
4399
|
|
|
cause: err, |
4400
|
|
|
} |
4401
|
|
|
} |
4402
|
|
|
} |
4403
|
|
|
|
4404
|
|
|
if len(errors) > 0 { |
4405
|
|
|
return WatchResponseMultiError(errors) |
4406
|
|
|
} |
4407
|
|
|
|
4408
|
|
|
return nil |
4409
|
|
|
} |
4410
|
|
|
|
4411
|
|
|
// WatchResponseMultiError is an error wrapping multiple validation errors |
4412
|
|
|
// returned by WatchResponse.ValidateAll() if the designated constraints |
4413
|
|
|
// aren't met. |
4414
|
|
|
type WatchResponseMultiError []error |
4415
|
|
|
|
4416
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4417
|
|
|
func (m WatchResponseMultiError) Error() string { |
4418
|
|
|
var msgs []string |
4419
|
|
|
for _, err := range m { |
4420
|
|
|
msgs = append(msgs, err.Error()) |
4421
|
|
|
} |
4422
|
|
|
return strings.Join(msgs, "; ") |
4423
|
|
|
} |
4424
|
|
|
|
4425
|
|
|
// AllErrors returns a list of validation violation errors. |
4426
|
|
|
func (m WatchResponseMultiError) AllErrors() []error { return m } |
4427
|
|
|
|
4428
|
|
|
// WatchResponseValidationError is the validation error returned by |
4429
|
|
|
// WatchResponse.Validate if the designated constraints aren't met. |
4430
|
|
|
type WatchResponseValidationError struct { |
4431
|
|
|
field string |
4432
|
|
|
reason string |
4433
|
|
|
cause error |
4434
|
|
|
key bool |
4435
|
|
|
} |
4436
|
|
|
|
4437
|
|
|
// Field function returns field value. |
4438
|
|
|
func (e WatchResponseValidationError) Field() string { return e.field } |
4439
|
|
|
|
4440
|
|
|
// Reason function returns reason value. |
4441
|
|
|
func (e WatchResponseValidationError) Reason() string { return e.reason } |
4442
|
|
|
|
4443
|
|
|
// Cause function returns cause value. |
4444
|
|
|
func (e WatchResponseValidationError) Cause() error { return e.cause } |
4445
|
|
|
|
4446
|
|
|
// Key function returns key value. |
4447
|
|
|
func (e WatchResponseValidationError) Key() bool { return e.key } |
4448
|
|
|
|
4449
|
|
|
// ErrorName returns error name. |
4450
|
|
|
func (e WatchResponseValidationError) ErrorName() string { return "WatchResponseValidationError" } |
4451
|
|
|
|
4452
|
|
|
// Error satisfies the builtin error interface |
4453
|
|
|
func (e WatchResponseValidationError) Error() string { |
4454
|
|
|
cause := "" |
4455
|
|
|
if e.cause != nil { |
4456
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4457
|
|
|
} |
4458
|
|
|
|
4459
|
|
|
key := "" |
4460
|
|
|
if e.key { |
4461
|
|
|
key = "key for " |
4462
|
|
|
} |
4463
|
|
|
|
4464
|
|
|
return fmt.Sprintf( |
4465
|
|
|
"invalid %sWatchResponse.%s: %s%s", |
4466
|
|
|
key, |
4467
|
|
|
e.field, |
4468
|
|
|
e.reason, |
4469
|
|
|
cause) |
4470
|
|
|
} |
4471
|
|
|
|
4472
|
|
|
var _ error = WatchResponseValidationError{} |
4473
|
|
|
|
4474
|
|
|
var _ interface { |
4475
|
|
|
Field() string |
4476
|
|
|
Reason() string |
4477
|
|
|
Key() bool |
4478
|
|
|
Cause() error |
4479
|
|
|
ErrorName() string |
4480
|
|
|
} = WatchResponseValidationError{} |
4481
|
|
|
|
4482
|
|
|
// Validate checks the field values on SchemaWriteRequest with the rules |
4483
|
|
|
// defined in the proto definition for this message. If any rules are |
4484
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4485
|
|
|
func (m *SchemaWriteRequest) Validate() error { |
4486
|
|
|
return m.validate(false) |
4487
|
|
|
} |
4488
|
|
|
|
4489
|
|
|
// ValidateAll checks the field values on SchemaWriteRequest with the rules |
4490
|
|
|
// defined in the proto definition for this message. If any rules are |
4491
|
|
|
// violated, the result is a list of violation errors wrapped in |
4492
|
|
|
// SchemaWriteRequestMultiError, or nil if none found. |
4493
|
|
|
func (m *SchemaWriteRequest) ValidateAll() error { |
4494
|
|
|
return m.validate(true) |
4495
|
|
|
} |
4496
|
|
|
|
4497
|
|
|
func (m *SchemaWriteRequest) validate(all bool) error { |
4498
|
|
|
if m == nil { |
4499
|
|
|
return nil |
4500
|
|
|
} |
4501
|
|
|
|
4502
|
|
|
var errors []error |
4503
|
|
|
|
4504
|
|
|
if len(m.GetTenantId()) > 128 { |
4505
|
|
|
err := SchemaWriteRequestValidationError{ |
4506
|
|
|
field: "TenantId", |
4507
|
|
|
reason: "value length must be at most 128 bytes", |
4508
|
|
|
} |
4509
|
|
|
if !all { |
4510
|
|
|
return err |
4511
|
|
|
} |
4512
|
|
|
errors = append(errors, err) |
4513
|
|
|
} |
4514
|
|
|
|
4515
|
|
|
if !_SchemaWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4516
|
|
|
err := SchemaWriteRequestValidationError{ |
4517
|
|
|
field: "TenantId", |
4518
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4519
|
|
|
} |
4520
|
|
|
if !all { |
4521
|
|
|
return err |
4522
|
|
|
} |
4523
|
|
|
errors = append(errors, err) |
4524
|
|
|
} |
4525
|
|
|
|
4526
|
|
|
// no validation rules for Schema |
4527
|
|
|
|
4528
|
|
|
if len(errors) > 0 { |
4529
|
|
|
return SchemaWriteRequestMultiError(errors) |
4530
|
|
|
} |
4531
|
|
|
|
4532
|
|
|
return nil |
4533
|
|
|
} |
4534
|
|
|
|
4535
|
|
|
// SchemaWriteRequestMultiError is an error wrapping multiple validation errors |
4536
|
|
|
// returned by SchemaWriteRequest.ValidateAll() if the designated constraints |
4537
|
|
|
// aren't met. |
4538
|
|
|
type SchemaWriteRequestMultiError []error |
4539
|
|
|
|
4540
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4541
|
|
|
func (m SchemaWriteRequestMultiError) Error() string { |
4542
|
|
|
var msgs []string |
4543
|
|
|
for _, err := range m { |
4544
|
|
|
msgs = append(msgs, err.Error()) |
4545
|
|
|
} |
4546
|
|
|
return strings.Join(msgs, "; ") |
4547
|
|
|
} |
4548
|
|
|
|
4549
|
|
|
// AllErrors returns a list of validation violation errors. |
4550
|
|
|
func (m SchemaWriteRequestMultiError) AllErrors() []error { return m } |
4551
|
|
|
|
4552
|
|
|
// SchemaWriteRequestValidationError is the validation error returned by |
4553
|
|
|
// SchemaWriteRequest.Validate if the designated constraints aren't met. |
4554
|
|
|
type SchemaWriteRequestValidationError struct { |
4555
|
|
|
field string |
4556
|
|
|
reason string |
4557
|
|
|
cause error |
4558
|
|
|
key bool |
4559
|
|
|
} |
4560
|
|
|
|
4561
|
|
|
// Field function returns field value. |
4562
|
|
|
func (e SchemaWriteRequestValidationError) Field() string { return e.field } |
4563
|
|
|
|
4564
|
|
|
// Reason function returns reason value. |
4565
|
|
|
func (e SchemaWriteRequestValidationError) Reason() string { return e.reason } |
4566
|
|
|
|
4567
|
|
|
// Cause function returns cause value. |
4568
|
|
|
func (e SchemaWriteRequestValidationError) Cause() error { return e.cause } |
4569
|
|
|
|
4570
|
|
|
// Key function returns key value. |
4571
|
|
|
func (e SchemaWriteRequestValidationError) Key() bool { return e.key } |
4572
|
|
|
|
4573
|
|
|
// ErrorName returns error name. |
4574
|
|
|
func (e SchemaWriteRequestValidationError) ErrorName() string { |
4575
|
|
|
return "SchemaWriteRequestValidationError" |
4576
|
|
|
} |
4577
|
|
|
|
4578
|
|
|
// Error satisfies the builtin error interface |
4579
|
|
|
func (e SchemaWriteRequestValidationError) Error() string { |
4580
|
|
|
cause := "" |
4581
|
|
|
if e.cause != nil { |
4582
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4583
|
|
|
} |
4584
|
|
|
|
4585
|
|
|
key := "" |
4586
|
|
|
if e.key { |
4587
|
|
|
key = "key for " |
4588
|
|
|
} |
4589
|
|
|
|
4590
|
|
|
return fmt.Sprintf( |
4591
|
|
|
"invalid %sSchemaWriteRequest.%s: %s%s", |
4592
|
|
|
key, |
4593
|
|
|
e.field, |
4594
|
|
|
e.reason, |
4595
|
|
|
cause) |
4596
|
|
|
} |
4597
|
|
|
|
4598
|
|
|
var _ error = SchemaWriteRequestValidationError{} |
4599
|
|
|
|
4600
|
|
|
var _ interface { |
4601
|
|
|
Field() string |
4602
|
|
|
Reason() string |
4603
|
|
|
Key() bool |
4604
|
|
|
Cause() error |
4605
|
|
|
ErrorName() string |
4606
|
|
|
} = SchemaWriteRequestValidationError{} |
4607
|
|
|
|
4608
|
|
|
var _SchemaWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4609
|
|
|
|
4610
|
|
|
// Validate checks the field values on SchemaWriteResponse with the rules |
4611
|
|
|
// defined in the proto definition for this message. If any rules are |
4612
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4613
|
|
|
func (m *SchemaWriteResponse) Validate() error { |
4614
|
|
|
return m.validate(false) |
4615
|
|
|
} |
4616
|
|
|
|
4617
|
|
|
// ValidateAll checks the field values on SchemaWriteResponse with the rules |
4618
|
|
|
// defined in the proto definition for this message. If any rules are |
4619
|
|
|
// violated, the result is a list of violation errors wrapped in |
4620
|
|
|
// SchemaWriteResponseMultiError, or nil if none found. |
4621
|
|
|
func (m *SchemaWriteResponse) ValidateAll() error { |
4622
|
|
|
return m.validate(true) |
4623
|
|
|
} |
4624
|
|
|
|
4625
|
|
|
func (m *SchemaWriteResponse) validate(all bool) error { |
4626
|
|
|
if m == nil { |
4627
|
|
|
return nil |
4628
|
|
|
} |
4629
|
|
|
|
4630
|
|
|
var errors []error |
4631
|
|
|
|
4632
|
|
|
// no validation rules for SchemaVersion |
4633
|
|
|
|
4634
|
|
|
if len(errors) > 0 { |
4635
|
|
|
return SchemaWriteResponseMultiError(errors) |
4636
|
|
|
} |
4637
|
|
|
|
4638
|
|
|
return nil |
4639
|
|
|
} |
4640
|
|
|
|
4641
|
|
|
// SchemaWriteResponseMultiError is an error wrapping multiple validation |
4642
|
|
|
// errors returned by SchemaWriteResponse.ValidateAll() if the designated |
4643
|
|
|
// constraints aren't met. |
4644
|
|
|
type SchemaWriteResponseMultiError []error |
4645
|
|
|
|
4646
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4647
|
|
|
func (m SchemaWriteResponseMultiError) Error() string { |
4648
|
|
|
var msgs []string |
4649
|
|
|
for _, err := range m { |
4650
|
|
|
msgs = append(msgs, err.Error()) |
4651
|
|
|
} |
4652
|
|
|
return strings.Join(msgs, "; ") |
4653
|
|
|
} |
4654
|
|
|
|
4655
|
|
|
// AllErrors returns a list of validation violation errors. |
4656
|
|
|
func (m SchemaWriteResponseMultiError) AllErrors() []error { return m } |
4657
|
|
|
|
4658
|
|
|
// SchemaWriteResponseValidationError is the validation error returned by |
4659
|
|
|
// SchemaWriteResponse.Validate if the designated constraints aren't met. |
4660
|
|
|
type SchemaWriteResponseValidationError struct { |
4661
|
|
|
field string |
4662
|
|
|
reason string |
4663
|
|
|
cause error |
4664
|
|
|
key bool |
4665
|
|
|
} |
4666
|
|
|
|
4667
|
|
|
// Field function returns field value. |
4668
|
|
|
func (e SchemaWriteResponseValidationError) Field() string { return e.field } |
4669
|
|
|
|
4670
|
|
|
// Reason function returns reason value. |
4671
|
|
|
func (e SchemaWriteResponseValidationError) Reason() string { return e.reason } |
4672
|
|
|
|
4673
|
|
|
// Cause function returns cause value. |
4674
|
|
|
func (e SchemaWriteResponseValidationError) Cause() error { return e.cause } |
4675
|
|
|
|
4676
|
|
|
// Key function returns key value. |
4677
|
|
|
func (e SchemaWriteResponseValidationError) Key() bool { return e.key } |
4678
|
|
|
|
4679
|
|
|
// ErrorName returns error name. |
4680
|
|
|
func (e SchemaWriteResponseValidationError) ErrorName() string { |
4681
|
|
|
return "SchemaWriteResponseValidationError" |
4682
|
|
|
} |
4683
|
|
|
|
4684
|
|
|
// Error satisfies the builtin error interface |
4685
|
|
|
func (e SchemaWriteResponseValidationError) Error() string { |
4686
|
|
|
cause := "" |
4687
|
|
|
if e.cause != nil { |
4688
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4689
|
|
|
} |
4690
|
|
|
|
4691
|
|
|
key := "" |
4692
|
|
|
if e.key { |
4693
|
|
|
key = "key for " |
4694
|
|
|
} |
4695
|
|
|
|
4696
|
|
|
return fmt.Sprintf( |
4697
|
|
|
"invalid %sSchemaWriteResponse.%s: %s%s", |
4698
|
|
|
key, |
4699
|
|
|
e.field, |
4700
|
|
|
e.reason, |
4701
|
|
|
cause) |
4702
|
|
|
} |
4703
|
|
|
|
4704
|
|
|
var _ error = SchemaWriteResponseValidationError{} |
4705
|
|
|
|
4706
|
|
|
var _ interface { |
4707
|
|
|
Field() string |
4708
|
|
|
Reason() string |
4709
|
|
|
Key() bool |
4710
|
|
|
Cause() error |
4711
|
|
|
ErrorName() string |
4712
|
|
|
} = SchemaWriteResponseValidationError{} |
4713
|
|
|
|
4714
|
|
|
// Validate checks the field values on SchemaPartialWriteRequest with the rules |
4715
|
|
|
// defined in the proto definition for this message. If any rules are |
4716
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4717
|
|
|
func (m *SchemaPartialWriteRequest) Validate() error { |
4718
|
|
|
return m.validate(false) |
4719
|
|
|
} |
4720
|
|
|
|
4721
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteRequest with the |
4722
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4723
|
|
|
// violated, the result is a list of violation errors wrapped in |
4724
|
|
|
// SchemaPartialWriteRequestMultiError, or nil if none found. |
4725
|
|
|
func (m *SchemaPartialWriteRequest) ValidateAll() error { |
4726
|
|
|
return m.validate(true) |
4727
|
|
|
} |
4728
|
|
|
|
4729
|
|
|
func (m *SchemaPartialWriteRequest) validate(all bool) error { |
4730
|
|
|
if m == nil { |
4731
|
|
|
return nil |
4732
|
|
|
} |
4733
|
|
|
|
4734
|
|
|
var errors []error |
4735
|
|
|
|
4736
|
|
|
if len(m.GetTenantId()) > 128 { |
4737
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
4738
|
|
|
field: "TenantId", |
4739
|
|
|
reason: "value length must be at most 128 bytes", |
4740
|
|
|
} |
4741
|
|
|
if !all { |
4742
|
|
|
return err |
4743
|
|
|
} |
4744
|
|
|
errors = append(errors, err) |
4745
|
|
|
} |
4746
|
|
|
|
4747
|
|
|
if !_SchemaPartialWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4748
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
4749
|
|
|
field: "TenantId", |
4750
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4751
|
|
|
} |
4752
|
|
|
if !all { |
4753
|
|
|
return err |
4754
|
|
|
} |
4755
|
|
|
errors = append(errors, err) |
4756
|
|
|
} |
4757
|
|
|
|
4758
|
|
|
if m.GetMetadata() == nil { |
4759
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
4760
|
|
|
field: "Metadata", |
4761
|
|
|
reason: "value is required", |
4762
|
|
|
} |
4763
|
|
|
if !all { |
4764
|
|
|
return err |
4765
|
|
|
} |
4766
|
|
|
errors = append(errors, err) |
4767
|
|
|
} |
4768
|
|
|
|
4769
|
|
|
if all { |
4770
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
4771
|
|
|
case interface{ ValidateAll() error }: |
4772
|
|
|
if err := v.ValidateAll(); err != nil { |
4773
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4774
|
|
|
field: "Metadata", |
4775
|
|
|
reason: "embedded message failed validation", |
4776
|
|
|
cause: err, |
4777
|
|
|
}) |
4778
|
|
|
} |
4779
|
|
|
case interface{ Validate() error }: |
4780
|
|
|
if err := v.Validate(); err != nil { |
4781
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4782
|
|
|
field: "Metadata", |
4783
|
|
|
reason: "embedded message failed validation", |
4784
|
|
|
cause: err, |
4785
|
|
|
}) |
4786
|
|
|
} |
4787
|
|
|
} |
4788
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
4789
|
|
|
if err := v.Validate(); err != nil { |
4790
|
|
|
return SchemaPartialWriteRequestValidationError{ |
4791
|
|
|
field: "Metadata", |
4792
|
|
|
reason: "embedded message failed validation", |
4793
|
|
|
cause: err, |
4794
|
|
|
} |
4795
|
|
|
} |
4796
|
|
|
} |
4797
|
|
|
|
4798
|
|
|
{ |
4799
|
|
|
sorted_keys := make([]string, len(m.GetPartials())) |
4800
|
|
|
i := 0 |
4801
|
|
|
for key := range m.GetPartials() { |
4802
|
|
|
sorted_keys[i] = key |
4803
|
|
|
i++ |
4804
|
|
|
} |
4805
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
4806
|
|
|
for _, key := range sorted_keys { |
4807
|
|
|
val := m.GetPartials()[key] |
4808
|
|
|
_ = val |
4809
|
|
|
|
4810
|
|
|
// no validation rules for Partials[key] |
4811
|
|
|
|
4812
|
|
|
if all { |
4813
|
|
|
switch v := interface{}(val).(type) { |
4814
|
|
|
case interface{ ValidateAll() error }: |
4815
|
|
|
if err := v.ValidateAll(); err != nil { |
4816
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4817
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4818
|
|
|
reason: "embedded message failed validation", |
4819
|
|
|
cause: err, |
4820
|
|
|
}) |
4821
|
|
|
} |
4822
|
|
|
case interface{ Validate() error }: |
4823
|
|
|
if err := v.Validate(); err != nil { |
4824
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4825
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4826
|
|
|
reason: "embedded message failed validation", |
4827
|
|
|
cause: err, |
4828
|
|
|
}) |
4829
|
|
|
} |
4830
|
|
|
} |
4831
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
4832
|
|
|
if err := v.Validate(); err != nil { |
4833
|
|
|
return SchemaPartialWriteRequestValidationError{ |
4834
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4835
|
|
|
reason: "embedded message failed validation", |
4836
|
|
|
cause: err, |
4837
|
|
|
} |
4838
|
|
|
} |
4839
|
|
|
} |
4840
|
|
|
|
4841
|
|
|
} |
4842
|
|
|
} |
4843
|
|
|
|
4844
|
|
|
if len(errors) > 0 { |
4845
|
|
|
return SchemaPartialWriteRequestMultiError(errors) |
4846
|
|
|
} |
4847
|
|
|
|
4848
|
|
|
return nil |
4849
|
|
|
} |
4850
|
|
|
|
4851
|
|
|
// SchemaPartialWriteRequestMultiError is an error wrapping multiple validation |
4852
|
|
|
// errors returned by SchemaPartialWriteRequest.ValidateAll() if the |
4853
|
|
|
// designated constraints aren't met. |
4854
|
|
|
type SchemaPartialWriteRequestMultiError []error |
4855
|
|
|
|
4856
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4857
|
|
|
func (m SchemaPartialWriteRequestMultiError) Error() string { |
4858
|
|
|
var msgs []string |
4859
|
|
|
for _, err := range m { |
4860
|
|
|
msgs = append(msgs, err.Error()) |
4861
|
|
|
} |
4862
|
|
|
return strings.Join(msgs, "; ") |
4863
|
|
|
} |
4864
|
|
|
|
4865
|
|
|
// AllErrors returns a list of validation violation errors. |
4866
|
|
|
func (m SchemaPartialWriteRequestMultiError) AllErrors() []error { return m } |
4867
|
|
|
|
4868
|
|
|
// SchemaPartialWriteRequestValidationError is the validation error returned by |
4869
|
|
|
// SchemaPartialWriteRequest.Validate if the designated constraints aren't met. |
4870
|
|
|
type SchemaPartialWriteRequestValidationError struct { |
4871
|
|
|
field string |
4872
|
|
|
reason string |
4873
|
|
|
cause error |
4874
|
|
|
key bool |
4875
|
|
|
} |
4876
|
|
|
|
4877
|
|
|
// Field function returns field value. |
4878
|
|
|
func (e SchemaPartialWriteRequestValidationError) Field() string { return e.field } |
4879
|
|
|
|
4880
|
|
|
// Reason function returns reason value. |
4881
|
|
|
func (e SchemaPartialWriteRequestValidationError) Reason() string { return e.reason } |
4882
|
|
|
|
4883
|
|
|
// Cause function returns cause value. |
4884
|
|
|
func (e SchemaPartialWriteRequestValidationError) Cause() error { return e.cause } |
4885
|
|
|
|
4886
|
|
|
// Key function returns key value. |
4887
|
|
|
func (e SchemaPartialWriteRequestValidationError) Key() bool { return e.key } |
4888
|
|
|
|
4889
|
|
|
// ErrorName returns error name. |
4890
|
|
|
func (e SchemaPartialWriteRequestValidationError) ErrorName() string { |
4891
|
|
|
return "SchemaPartialWriteRequestValidationError" |
4892
|
|
|
} |
4893
|
|
|
|
4894
|
|
|
// Error satisfies the builtin error interface |
4895
|
|
|
func (e SchemaPartialWriteRequestValidationError) Error() string { |
4896
|
|
|
cause := "" |
4897
|
|
|
if e.cause != nil { |
4898
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4899
|
|
|
} |
4900
|
|
|
|
4901
|
|
|
key := "" |
4902
|
|
|
if e.key { |
4903
|
|
|
key = "key for " |
4904
|
|
|
} |
4905
|
|
|
|
4906
|
|
|
return fmt.Sprintf( |
4907
|
|
|
"invalid %sSchemaPartialWriteRequest.%s: %s%s", |
4908
|
|
|
key, |
4909
|
|
|
e.field, |
4910
|
|
|
e.reason, |
4911
|
|
|
cause) |
4912
|
|
|
} |
4913
|
|
|
|
4914
|
|
|
var _ error = SchemaPartialWriteRequestValidationError{} |
4915
|
|
|
|
4916
|
|
|
var _ interface { |
4917
|
|
|
Field() string |
4918
|
|
|
Reason() string |
4919
|
|
|
Key() bool |
4920
|
|
|
Cause() error |
4921
|
|
|
ErrorName() string |
4922
|
|
|
} = SchemaPartialWriteRequestValidationError{} |
4923
|
|
|
|
4924
|
|
|
var _SchemaPartialWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4925
|
|
|
|
4926
|
|
|
// Validate checks the field values on SchemaPartialWriteRequestMetadata with |
4927
|
|
|
// the rules defined in the proto definition for this message. If any rules |
4928
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
4929
|
|
|
// no violations. |
4930
|
|
|
func (m *SchemaPartialWriteRequestMetadata) Validate() error { |
4931
|
|
|
return m.validate(false) |
4932
|
|
|
} |
4933
|
|
|
|
4934
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteRequestMetadata |
4935
|
|
|
// with the rules defined in the proto definition for this message. If any |
4936
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
4937
|
|
|
// SchemaPartialWriteRequestMetadataMultiError, or nil if none found. |
4938
|
|
|
func (m *SchemaPartialWriteRequestMetadata) ValidateAll() error { |
4939
|
|
|
return m.validate(true) |
4940
|
|
|
} |
4941
|
|
|
|
4942
|
|
|
func (m *SchemaPartialWriteRequestMetadata) validate(all bool) error { |
4943
|
|
|
if m == nil { |
4944
|
|
|
return nil |
4945
|
|
|
} |
4946
|
|
|
|
4947
|
|
|
var errors []error |
4948
|
|
|
|
4949
|
|
|
// no validation rules for SchemaVersion |
4950
|
|
|
|
4951
|
|
|
if len(errors) > 0 { |
4952
|
|
|
return SchemaPartialWriteRequestMetadataMultiError(errors) |
4953
|
|
|
} |
4954
|
|
|
|
4955
|
|
|
return nil |
4956
|
|
|
} |
4957
|
|
|
|
4958
|
|
|
// SchemaPartialWriteRequestMetadataMultiError is an error wrapping multiple |
4959
|
|
|
// validation errors returned by |
4960
|
|
|
// SchemaPartialWriteRequestMetadata.ValidateAll() if the designated |
4961
|
|
|
// constraints aren't met. |
4962
|
|
|
type SchemaPartialWriteRequestMetadataMultiError []error |
4963
|
|
|
|
4964
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4965
|
|
|
func (m SchemaPartialWriteRequestMetadataMultiError) Error() string { |
4966
|
|
|
var msgs []string |
4967
|
|
|
for _, err := range m { |
4968
|
|
|
msgs = append(msgs, err.Error()) |
4969
|
|
|
} |
4970
|
|
|
return strings.Join(msgs, "; ") |
4971
|
|
|
} |
4972
|
|
|
|
4973
|
|
|
// AllErrors returns a list of validation violation errors. |
4974
|
|
|
func (m SchemaPartialWriteRequestMetadataMultiError) AllErrors() []error { return m } |
4975
|
|
|
|
4976
|
|
|
// SchemaPartialWriteRequestMetadataValidationError is the validation error |
4977
|
|
|
// returned by SchemaPartialWriteRequestMetadata.Validate if the designated |
4978
|
|
|
// constraints aren't met. |
4979
|
|
|
type SchemaPartialWriteRequestMetadataValidationError struct { |
4980
|
|
|
field string |
4981
|
|
|
reason string |
4982
|
|
|
cause error |
4983
|
|
|
key bool |
4984
|
|
|
} |
4985
|
|
|
|
4986
|
|
|
// Field function returns field value. |
4987
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Field() string { return e.field } |
4988
|
|
|
|
4989
|
|
|
// Reason function returns reason value. |
4990
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Reason() string { return e.reason } |
4991
|
|
|
|
4992
|
|
|
// Cause function returns cause value. |
4993
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Cause() error { return e.cause } |
4994
|
|
|
|
4995
|
|
|
// Key function returns key value. |
4996
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Key() bool { return e.key } |
4997
|
|
|
|
4998
|
|
|
// ErrorName returns error name. |
4999
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) ErrorName() string { |
5000
|
|
|
return "SchemaPartialWriteRequestMetadataValidationError" |
5001
|
|
|
} |
5002
|
|
|
|
5003
|
|
|
// Error satisfies the builtin error interface |
5004
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Error() string { |
5005
|
|
|
cause := "" |
5006
|
|
|
if e.cause != nil { |
5007
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5008
|
|
|
} |
5009
|
|
|
|
5010
|
|
|
key := "" |
5011
|
|
|
if e.key { |
5012
|
|
|
key = "key for " |
5013
|
|
|
} |
5014
|
|
|
|
5015
|
|
|
return fmt.Sprintf( |
5016
|
|
|
"invalid %sSchemaPartialWriteRequestMetadata.%s: %s%s", |
5017
|
|
|
key, |
5018
|
|
|
e.field, |
5019
|
|
|
e.reason, |
5020
|
|
|
cause) |
5021
|
|
|
} |
5022
|
|
|
|
5023
|
|
|
var _ error = SchemaPartialWriteRequestMetadataValidationError{} |
5024
|
|
|
|
5025
|
|
|
var _ interface { |
5026
|
|
|
Field() string |
5027
|
|
|
Reason() string |
5028
|
|
|
Key() bool |
5029
|
|
|
Cause() error |
5030
|
|
|
ErrorName() string |
5031
|
|
|
} = SchemaPartialWriteRequestMetadataValidationError{} |
5032
|
|
|
|
5033
|
|
|
// Validate checks the field values on SchemaPartialWriteResponse with the |
5034
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5035
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5036
|
|
|
func (m *SchemaPartialWriteResponse) Validate() error { |
5037
|
|
|
return m.validate(false) |
5038
|
|
|
} |
5039
|
|
|
|
5040
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteResponse with the |
5041
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5042
|
|
|
// violated, the result is a list of violation errors wrapped in |
5043
|
|
|
// SchemaPartialWriteResponseMultiError, or nil if none found. |
5044
|
|
|
func (m *SchemaPartialWriteResponse) ValidateAll() error { |
5045
|
|
|
return m.validate(true) |
5046
|
|
|
} |
5047
|
|
|
|
5048
|
|
|
func (m *SchemaPartialWriteResponse) validate(all bool) error { |
5049
|
|
|
if m == nil { |
5050
|
|
|
return nil |
5051
|
|
|
} |
5052
|
|
|
|
5053
|
|
|
var errors []error |
5054
|
|
|
|
5055
|
|
|
// no validation rules for SchemaVersion |
5056
|
|
|
|
5057
|
|
|
if len(errors) > 0 { |
5058
|
|
|
return SchemaPartialWriteResponseMultiError(errors) |
5059
|
|
|
} |
5060
|
|
|
|
5061
|
|
|
return nil |
5062
|
|
|
} |
5063
|
|
|
|
5064
|
|
|
// SchemaPartialWriteResponseMultiError is an error wrapping multiple |
5065
|
|
|
// validation errors returned by SchemaPartialWriteResponse.ValidateAll() if |
5066
|
|
|
// the designated constraints aren't met. |
5067
|
|
|
type SchemaPartialWriteResponseMultiError []error |
5068
|
|
|
|
5069
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5070
|
|
|
func (m SchemaPartialWriteResponseMultiError) Error() string { |
5071
|
|
|
var msgs []string |
5072
|
|
|
for _, err := range m { |
5073
|
|
|
msgs = append(msgs, err.Error()) |
5074
|
|
|
} |
5075
|
|
|
return strings.Join(msgs, "; ") |
5076
|
|
|
} |
5077
|
|
|
|
5078
|
|
|
// AllErrors returns a list of validation violation errors. |
5079
|
|
|
func (m SchemaPartialWriteResponseMultiError) AllErrors() []error { return m } |
5080
|
|
|
|
5081
|
|
|
// SchemaPartialWriteResponseValidationError is the validation error returned |
5082
|
|
|
// by SchemaPartialWriteResponse.Validate if the designated constraints aren't met. |
5083
|
|
|
type SchemaPartialWriteResponseValidationError struct { |
5084
|
|
|
field string |
5085
|
|
|
reason string |
5086
|
|
|
cause error |
5087
|
|
|
key bool |
5088
|
|
|
} |
5089
|
|
|
|
5090
|
|
|
// Field function returns field value. |
5091
|
|
|
func (e SchemaPartialWriteResponseValidationError) Field() string { return e.field } |
5092
|
|
|
|
5093
|
|
|
// Reason function returns reason value. |
5094
|
|
|
func (e SchemaPartialWriteResponseValidationError) Reason() string { return e.reason } |
5095
|
|
|
|
5096
|
|
|
// Cause function returns cause value. |
5097
|
|
|
func (e SchemaPartialWriteResponseValidationError) Cause() error { return e.cause } |
5098
|
|
|
|
5099
|
|
|
// Key function returns key value. |
5100
|
|
|
func (e SchemaPartialWriteResponseValidationError) Key() bool { return e.key } |
5101
|
|
|
|
5102
|
|
|
// ErrorName returns error name. |
5103
|
|
|
func (e SchemaPartialWriteResponseValidationError) ErrorName() string { |
5104
|
|
|
return "SchemaPartialWriteResponseValidationError" |
5105
|
|
|
} |
5106
|
|
|
|
5107
|
|
|
// Error satisfies the builtin error interface |
5108
|
|
|
func (e SchemaPartialWriteResponseValidationError) Error() string { |
5109
|
|
|
cause := "" |
5110
|
|
|
if e.cause != nil { |
5111
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5112
|
|
|
} |
5113
|
|
|
|
5114
|
|
|
key := "" |
5115
|
|
|
if e.key { |
5116
|
|
|
key = "key for " |
5117
|
|
|
} |
5118
|
|
|
|
5119
|
|
|
return fmt.Sprintf( |
5120
|
|
|
"invalid %sSchemaPartialWriteResponse.%s: %s%s", |
5121
|
|
|
key, |
5122
|
|
|
e.field, |
5123
|
|
|
e.reason, |
5124
|
|
|
cause) |
5125
|
|
|
} |
5126
|
|
|
|
5127
|
|
|
var _ error = SchemaPartialWriteResponseValidationError{} |
5128
|
|
|
|
5129
|
|
|
var _ interface { |
5130
|
|
|
Field() string |
5131
|
|
|
Reason() string |
5132
|
|
|
Key() bool |
5133
|
|
|
Cause() error |
5134
|
|
|
ErrorName() string |
5135
|
|
|
} = SchemaPartialWriteResponseValidationError{} |
5136
|
|
|
|
5137
|
|
|
// Validate checks the field values on SchemaReadRequest with the rules defined |
5138
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5139
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5140
|
|
|
func (m *SchemaReadRequest) Validate() error { |
5141
|
|
|
return m.validate(false) |
5142
|
|
|
} |
5143
|
|
|
|
5144
|
|
|
// ValidateAll checks the field values on SchemaReadRequest with the rules |
5145
|
|
|
// defined in the proto definition for this message. If any rules are |
5146
|
|
|
// violated, the result is a list of violation errors wrapped in |
5147
|
|
|
// SchemaReadRequestMultiError, or nil if none found. |
5148
|
|
|
func (m *SchemaReadRequest) ValidateAll() error { |
5149
|
|
|
return m.validate(true) |
5150
|
|
|
} |
5151
|
|
|
|
5152
|
|
|
func (m *SchemaReadRequest) validate(all bool) error { |
5153
|
|
|
if m == nil { |
5154
|
|
|
return nil |
5155
|
|
|
} |
5156
|
|
|
|
5157
|
|
|
var errors []error |
5158
|
|
|
|
5159
|
|
|
if len(m.GetTenantId()) > 128 { |
5160
|
|
|
err := SchemaReadRequestValidationError{ |
5161
|
|
|
field: "TenantId", |
5162
|
|
|
reason: "value length must be at most 128 bytes", |
5163
|
|
|
} |
5164
|
|
|
if !all { |
5165
|
|
|
return err |
5166
|
|
|
} |
5167
|
|
|
errors = append(errors, err) |
5168
|
|
|
} |
5169
|
|
|
|
5170
|
|
|
if !_SchemaReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5171
|
|
|
err := SchemaReadRequestValidationError{ |
5172
|
|
|
field: "TenantId", |
5173
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5174
|
|
|
} |
5175
|
|
|
if !all { |
5176
|
|
|
return err |
5177
|
|
|
} |
5178
|
|
|
errors = append(errors, err) |
5179
|
|
|
} |
5180
|
|
|
|
5181
|
|
|
if m.GetMetadata() == nil { |
5182
|
|
|
err := SchemaReadRequestValidationError{ |
5183
|
|
|
field: "Metadata", |
5184
|
|
|
reason: "value is required", |
5185
|
|
|
} |
5186
|
|
|
if !all { |
5187
|
|
|
return err |
5188
|
|
|
} |
5189
|
|
|
errors = append(errors, err) |
5190
|
|
|
} |
5191
|
|
|
|
5192
|
|
|
if all { |
5193
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
5194
|
|
|
case interface{ ValidateAll() error }: |
5195
|
|
|
if err := v.ValidateAll(); err != nil { |
5196
|
|
|
errors = append(errors, SchemaReadRequestValidationError{ |
5197
|
|
|
field: "Metadata", |
5198
|
|
|
reason: "embedded message failed validation", |
5199
|
|
|
cause: err, |
5200
|
|
|
}) |
5201
|
|
|
} |
5202
|
|
|
case interface{ Validate() error }: |
5203
|
|
|
if err := v.Validate(); err != nil { |
5204
|
|
|
errors = append(errors, SchemaReadRequestValidationError{ |
5205
|
|
|
field: "Metadata", |
5206
|
|
|
reason: "embedded message failed validation", |
5207
|
|
|
cause: err, |
5208
|
|
|
}) |
5209
|
|
|
} |
5210
|
|
|
} |
5211
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
5212
|
|
|
if err := v.Validate(); err != nil { |
5213
|
|
|
return SchemaReadRequestValidationError{ |
5214
|
|
|
field: "Metadata", |
5215
|
|
|
reason: "embedded message failed validation", |
5216
|
|
|
cause: err, |
5217
|
|
|
} |
5218
|
|
|
} |
5219
|
|
|
} |
5220
|
|
|
|
5221
|
|
|
if len(errors) > 0 { |
5222
|
|
|
return SchemaReadRequestMultiError(errors) |
5223
|
|
|
} |
5224
|
|
|
|
5225
|
|
|
return nil |
5226
|
|
|
} |
5227
|
|
|
|
5228
|
|
|
// SchemaReadRequestMultiError is an error wrapping multiple validation errors |
5229
|
|
|
// returned by SchemaReadRequest.ValidateAll() if the designated constraints |
5230
|
|
|
// aren't met. |
5231
|
|
|
type SchemaReadRequestMultiError []error |
5232
|
|
|
|
5233
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5234
|
|
|
func (m SchemaReadRequestMultiError) Error() string { |
5235
|
|
|
var msgs []string |
5236
|
|
|
for _, err := range m { |
5237
|
|
|
msgs = append(msgs, err.Error()) |
5238
|
|
|
} |
5239
|
|
|
return strings.Join(msgs, "; ") |
5240
|
|
|
} |
5241
|
|
|
|
5242
|
|
|
// AllErrors returns a list of validation violation errors. |
5243
|
|
|
func (m SchemaReadRequestMultiError) AllErrors() []error { return m } |
5244
|
|
|
|
5245
|
|
|
// SchemaReadRequestValidationError is the validation error returned by |
5246
|
|
|
// SchemaReadRequest.Validate if the designated constraints aren't met. |
5247
|
|
|
type SchemaReadRequestValidationError struct { |
5248
|
|
|
field string |
5249
|
|
|
reason string |
5250
|
|
|
cause error |
5251
|
|
|
key bool |
5252
|
|
|
} |
5253
|
|
|
|
5254
|
|
|
// Field function returns field value. |
5255
|
|
|
func (e SchemaReadRequestValidationError) Field() string { return e.field } |
5256
|
|
|
|
5257
|
|
|
// Reason function returns reason value. |
5258
|
|
|
func (e SchemaReadRequestValidationError) Reason() string { return e.reason } |
5259
|
|
|
|
5260
|
|
|
// Cause function returns cause value. |
5261
|
|
|
func (e SchemaReadRequestValidationError) Cause() error { return e.cause } |
5262
|
|
|
|
5263
|
|
|
// Key function returns key value. |
5264
|
|
|
func (e SchemaReadRequestValidationError) Key() bool { return e.key } |
5265
|
|
|
|
5266
|
|
|
// ErrorName returns error name. |
5267
|
|
|
func (e SchemaReadRequestValidationError) ErrorName() string { |
5268
|
|
|
return "SchemaReadRequestValidationError" |
5269
|
|
|
} |
5270
|
|
|
|
5271
|
|
|
// Error satisfies the builtin error interface |
5272
|
|
|
func (e SchemaReadRequestValidationError) Error() string { |
5273
|
|
|
cause := "" |
5274
|
|
|
if e.cause != nil { |
5275
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5276
|
|
|
} |
5277
|
|
|
|
5278
|
|
|
key := "" |
5279
|
|
|
if e.key { |
5280
|
|
|
key = "key for " |
5281
|
|
|
} |
5282
|
|
|
|
5283
|
|
|
return fmt.Sprintf( |
5284
|
|
|
"invalid %sSchemaReadRequest.%s: %s%s", |
5285
|
|
|
key, |
5286
|
|
|
e.field, |
5287
|
|
|
e.reason, |
5288
|
|
|
cause) |
5289
|
|
|
} |
5290
|
|
|
|
5291
|
|
|
var _ error = SchemaReadRequestValidationError{} |
5292
|
|
|
|
5293
|
|
|
var _ interface { |
5294
|
|
|
Field() string |
5295
|
|
|
Reason() string |
5296
|
|
|
Key() bool |
5297
|
|
|
Cause() error |
5298
|
|
|
ErrorName() string |
5299
|
|
|
} = SchemaReadRequestValidationError{} |
5300
|
|
|
|
5301
|
|
|
var _SchemaReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
5302
|
|
|
|
5303
|
|
|
// Validate checks the field values on SchemaReadRequestMetadata with the rules |
5304
|
|
|
// defined in the proto definition for this message. If any rules are |
5305
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5306
|
|
|
func (m *SchemaReadRequestMetadata) Validate() error { |
5307
|
|
|
return m.validate(false) |
5308
|
|
|
} |
5309
|
|
|
|
5310
|
|
|
// ValidateAll checks the field values on SchemaReadRequestMetadata with the |
5311
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5312
|
|
|
// violated, the result is a list of violation errors wrapped in |
5313
|
|
|
// SchemaReadRequestMetadataMultiError, or nil if none found. |
5314
|
|
|
func (m *SchemaReadRequestMetadata) ValidateAll() error { |
5315
|
|
|
return m.validate(true) |
5316
|
|
|
} |
5317
|
|
|
|
5318
|
|
|
func (m *SchemaReadRequestMetadata) validate(all bool) error { |
5319
|
|
|
if m == nil { |
5320
|
|
|
return nil |
5321
|
|
|
} |
5322
|
|
|
|
5323
|
|
|
var errors []error |
5324
|
|
|
|
5325
|
|
|
// no validation rules for SchemaVersion |
5326
|
|
|
|
5327
|
|
|
if len(errors) > 0 { |
5328
|
|
|
return SchemaReadRequestMetadataMultiError(errors) |
5329
|
|
|
} |
5330
|
|
|
|
5331
|
|
|
return nil |
5332
|
|
|
} |
5333
|
|
|
|
5334
|
|
|
// SchemaReadRequestMetadataMultiError is an error wrapping multiple validation |
5335
|
|
|
// errors returned by SchemaReadRequestMetadata.ValidateAll() if the |
5336
|
|
|
// designated constraints aren't met. |
5337
|
|
|
type SchemaReadRequestMetadataMultiError []error |
5338
|
|
|
|
5339
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5340
|
|
|
func (m SchemaReadRequestMetadataMultiError) Error() string { |
5341
|
|
|
var msgs []string |
5342
|
|
|
for _, err := range m { |
5343
|
|
|
msgs = append(msgs, err.Error()) |
5344
|
|
|
} |
5345
|
|
|
return strings.Join(msgs, "; ") |
5346
|
|
|
} |
5347
|
|
|
|
5348
|
|
|
// AllErrors returns a list of validation violation errors. |
5349
|
|
|
func (m SchemaReadRequestMetadataMultiError) AllErrors() []error { return m } |
5350
|
|
|
|
5351
|
|
|
// SchemaReadRequestMetadataValidationError is the validation error returned by |
5352
|
|
|
// SchemaReadRequestMetadata.Validate if the designated constraints aren't met. |
5353
|
|
|
type SchemaReadRequestMetadataValidationError struct { |
5354
|
|
|
field string |
5355
|
|
|
reason string |
5356
|
|
|
cause error |
5357
|
|
|
key bool |
5358
|
|
|
} |
5359
|
|
|
|
5360
|
|
|
// Field function returns field value. |
5361
|
|
|
func (e SchemaReadRequestMetadataValidationError) Field() string { return e.field } |
5362
|
|
|
|
5363
|
|
|
// Reason function returns reason value. |
5364
|
|
|
func (e SchemaReadRequestMetadataValidationError) Reason() string { return e.reason } |
5365
|
|
|
|
5366
|
|
|
// Cause function returns cause value. |
5367
|
|
|
func (e SchemaReadRequestMetadataValidationError) Cause() error { return e.cause } |
5368
|
|
|
|
5369
|
|
|
// Key function returns key value. |
5370
|
|
|
func (e SchemaReadRequestMetadataValidationError) Key() bool { return e.key } |
5371
|
|
|
|
5372
|
|
|
// ErrorName returns error name. |
5373
|
|
|
func (e SchemaReadRequestMetadataValidationError) ErrorName() string { |
5374
|
|
|
return "SchemaReadRequestMetadataValidationError" |
5375
|
|
|
} |
5376
|
|
|
|
5377
|
|
|
// Error satisfies the builtin error interface |
5378
|
|
|
func (e SchemaReadRequestMetadataValidationError) Error() string { |
5379
|
|
|
cause := "" |
5380
|
|
|
if e.cause != nil { |
5381
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5382
|
|
|
} |
5383
|
|
|
|
5384
|
|
|
key := "" |
5385
|
|
|
if e.key { |
5386
|
|
|
key = "key for " |
5387
|
|
|
} |
5388
|
|
|
|
5389
|
|
|
return fmt.Sprintf( |
5390
|
|
|
"invalid %sSchemaReadRequestMetadata.%s: %s%s", |
5391
|
|
|
key, |
5392
|
|
|
e.field, |
5393
|
|
|
e.reason, |
5394
|
|
|
cause) |
5395
|
|
|
} |
5396
|
|
|
|
5397
|
|
|
var _ error = SchemaReadRequestMetadataValidationError{} |
5398
|
|
|
|
5399
|
|
|
var _ interface { |
5400
|
|
|
Field() string |
5401
|
|
|
Reason() string |
5402
|
|
|
Key() bool |
5403
|
|
|
Cause() error |
5404
|
|
|
ErrorName() string |
5405
|
|
|
} = SchemaReadRequestMetadataValidationError{} |
5406
|
|
|
|
5407
|
|
|
// Validate checks the field values on SchemaReadResponse with the rules |
5408
|
|
|
// defined in the proto definition for this message. If any rules are |
5409
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5410
|
|
|
func (m *SchemaReadResponse) Validate() error { |
5411
|
|
|
return m.validate(false) |
5412
|
|
|
} |
5413
|
|
|
|
5414
|
|
|
// ValidateAll checks the field values on SchemaReadResponse with the rules |
5415
|
|
|
// defined in the proto definition for this message. If any rules are |
5416
|
|
|
// violated, the result is a list of violation errors wrapped in |
5417
|
|
|
// SchemaReadResponseMultiError, or nil if none found. |
5418
|
|
|
func (m *SchemaReadResponse) ValidateAll() error { |
5419
|
|
|
return m.validate(true) |
5420
|
|
|
} |
5421
|
|
|
|
5422
|
|
|
func (m *SchemaReadResponse) validate(all bool) error { |
5423
|
|
|
if m == nil { |
5424
|
|
|
return nil |
5425
|
|
|
} |
5426
|
|
|
|
5427
|
|
|
var errors []error |
5428
|
|
|
|
5429
|
|
|
if all { |
5430
|
|
|
switch v := interface{}(m.GetSchema()).(type) { |
5431
|
|
|
case interface{ ValidateAll() error }: |
5432
|
|
|
if err := v.ValidateAll(); err != nil { |
5433
|
|
|
errors = append(errors, SchemaReadResponseValidationError{ |
5434
|
|
|
field: "Schema", |
5435
|
|
|
reason: "embedded message failed validation", |
5436
|
|
|
cause: err, |
5437
|
|
|
}) |
5438
|
|
|
} |
5439
|
|
|
case interface{ Validate() error }: |
5440
|
|
|
if err := v.Validate(); err != nil { |
5441
|
|
|
errors = append(errors, SchemaReadResponseValidationError{ |
5442
|
|
|
field: "Schema", |
5443
|
|
|
reason: "embedded message failed validation", |
5444
|
|
|
cause: err, |
5445
|
|
|
}) |
5446
|
|
|
} |
5447
|
|
|
} |
5448
|
|
|
} else if v, ok := interface{}(m.GetSchema()).(interface{ Validate() error }); ok { |
5449
|
|
|
if err := v.Validate(); err != nil { |
5450
|
|
|
return SchemaReadResponseValidationError{ |
5451
|
|
|
field: "Schema", |
5452
|
|
|
reason: "embedded message failed validation", |
5453
|
|
|
cause: err, |
5454
|
|
|
} |
5455
|
|
|
} |
5456
|
|
|
} |
5457
|
|
|
|
5458
|
|
|
if len(errors) > 0 { |
5459
|
|
|
return SchemaReadResponseMultiError(errors) |
5460
|
|
|
} |
5461
|
|
|
|
5462
|
|
|
return nil |
5463
|
|
|
} |
5464
|
|
|
|
5465
|
|
|
// SchemaReadResponseMultiError is an error wrapping multiple validation errors |
5466
|
|
|
// returned by SchemaReadResponse.ValidateAll() if the designated constraints |
5467
|
|
|
// aren't met. |
5468
|
|
|
type SchemaReadResponseMultiError []error |
5469
|
|
|
|
5470
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5471
|
|
|
func (m SchemaReadResponseMultiError) Error() string { |
5472
|
|
|
var msgs []string |
5473
|
|
|
for _, err := range m { |
5474
|
|
|
msgs = append(msgs, err.Error()) |
5475
|
|
|
} |
5476
|
|
|
return strings.Join(msgs, "; ") |
5477
|
|
|
} |
5478
|
|
|
|
5479
|
|
|
// AllErrors returns a list of validation violation errors. |
5480
|
|
|
func (m SchemaReadResponseMultiError) AllErrors() []error { return m } |
5481
|
|
|
|
5482
|
|
|
// SchemaReadResponseValidationError is the validation error returned by |
5483
|
|
|
// SchemaReadResponse.Validate if the designated constraints aren't met. |
5484
|
|
|
type SchemaReadResponseValidationError struct { |
5485
|
|
|
field string |
5486
|
|
|
reason string |
5487
|
|
|
cause error |
5488
|
|
|
key bool |
5489
|
|
|
} |
5490
|
|
|
|
5491
|
|
|
// Field function returns field value. |
5492
|
|
|
func (e SchemaReadResponseValidationError) Field() string { return e.field } |
5493
|
|
|
|
5494
|
|
|
// Reason function returns reason value. |
5495
|
|
|
func (e SchemaReadResponseValidationError) Reason() string { return e.reason } |
5496
|
|
|
|
5497
|
|
|
// Cause function returns cause value. |
5498
|
|
|
func (e SchemaReadResponseValidationError) Cause() error { return e.cause } |
5499
|
|
|
|
5500
|
|
|
// Key function returns key value. |
5501
|
|
|
func (e SchemaReadResponseValidationError) Key() bool { return e.key } |
5502
|
|
|
|
5503
|
|
|
// ErrorName returns error name. |
5504
|
|
|
func (e SchemaReadResponseValidationError) ErrorName() string { |
5505
|
|
|
return "SchemaReadResponseValidationError" |
5506
|
|
|
} |
5507
|
|
|
|
5508
|
|
|
// Error satisfies the builtin error interface |
5509
|
|
|
func (e SchemaReadResponseValidationError) Error() string { |
5510
|
|
|
cause := "" |
5511
|
|
|
if e.cause != nil { |
5512
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5513
|
|
|
} |
5514
|
|
|
|
5515
|
|
|
key := "" |
5516
|
|
|
if e.key { |
5517
|
|
|
key = "key for " |
5518
|
|
|
} |
5519
|
|
|
|
5520
|
|
|
return fmt.Sprintf( |
5521
|
|
|
"invalid %sSchemaReadResponse.%s: %s%s", |
5522
|
|
|
key, |
5523
|
|
|
e.field, |
5524
|
|
|
e.reason, |
5525
|
|
|
cause) |
5526
|
|
|
} |
5527
|
|
|
|
5528
|
|
|
var _ error = SchemaReadResponseValidationError{} |
5529
|
|
|
|
5530
|
|
|
var _ interface { |
5531
|
|
|
Field() string |
5532
|
|
|
Reason() string |
5533
|
|
|
Key() bool |
5534
|
|
|
Cause() error |
5535
|
|
|
ErrorName() string |
5536
|
|
|
} = SchemaReadResponseValidationError{} |
5537
|
|
|
|
5538
|
|
|
// Validate checks the field values on SchemaListRequest with the rules defined |
5539
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5540
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5541
|
|
|
func (m *SchemaListRequest) Validate() error { |
5542
|
|
|
return m.validate(false) |
5543
|
|
|
} |
5544
|
|
|
|
5545
|
|
|
// ValidateAll checks the field values on SchemaListRequest with the rules |
5546
|
|
|
// defined in the proto definition for this message. If any rules are |
5547
|
|
|
// violated, the result is a list of violation errors wrapped in |
5548
|
|
|
// SchemaListRequestMultiError, or nil if none found. |
5549
|
|
|
func (m *SchemaListRequest) ValidateAll() error { |
5550
|
|
|
return m.validate(true) |
5551
|
|
|
} |
5552
|
|
|
|
5553
|
|
|
func (m *SchemaListRequest) validate(all bool) error { |
5554
|
|
|
if m == nil { |
5555
|
|
|
return nil |
5556
|
|
|
} |
5557
|
|
|
|
5558
|
|
|
var errors []error |
5559
|
|
|
|
5560
|
|
|
if len(m.GetTenantId()) > 128 { |
5561
|
|
|
err := SchemaListRequestValidationError{ |
5562
|
|
|
field: "TenantId", |
5563
|
|
|
reason: "value length must be at most 128 bytes", |
5564
|
|
|
} |
5565
|
|
|
if !all { |
5566
|
|
|
return err |
5567
|
|
|
} |
5568
|
|
|
errors = append(errors, err) |
5569
|
|
|
} |
5570
|
|
|
|
5571
|
|
|
if !_SchemaListRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5572
|
|
|
err := SchemaListRequestValidationError{ |
5573
|
|
|
field: "TenantId", |
5574
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5575
|
|
|
} |
5576
|
|
|
if !all { |
5577
|
|
|
return err |
5578
|
|
|
} |
5579
|
|
|
errors = append(errors, err) |
5580
|
|
|
} |
5581
|
|
|
|
5582
|
|
|
if m.GetPageSize() != 0 { |
5583
|
|
|
|
5584
|
|
|
if m.GetPageSize() < 1 { |
5585
|
|
|
err := SchemaListRequestValidationError{ |
5586
|
|
|
field: "PageSize", |
5587
|
|
|
reason: "value must be greater than or equal to 1", |
5588
|
|
|
} |
5589
|
|
|
if !all { |
5590
|
|
|
return err |
5591
|
|
|
} |
5592
|
|
|
errors = append(errors, err) |
5593
|
|
|
} |
5594
|
|
|
|
5595
|
|
|
} |
5596
|
|
|
|
5597
|
|
|
if m.GetContinuousToken() != "" { |
5598
|
|
|
|
5599
|
|
|
} |
5600
|
|
|
|
5601
|
|
|
if len(errors) > 0 { |
5602
|
|
|
return SchemaListRequestMultiError(errors) |
5603
|
|
|
} |
5604
|
|
|
|
5605
|
|
|
return nil |
5606
|
|
|
} |
5607
|
|
|
|
5608
|
|
|
// SchemaListRequestMultiError is an error wrapping multiple validation errors |
5609
|
|
|
// returned by SchemaListRequest.ValidateAll() if the designated constraints |
5610
|
|
|
// aren't met. |
5611
|
|
|
type SchemaListRequestMultiError []error |
5612
|
|
|
|
5613
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5614
|
|
|
func (m SchemaListRequestMultiError) Error() string { |
5615
|
|
|
var msgs []string |
5616
|
|
|
for _, err := range m { |
5617
|
|
|
msgs = append(msgs, err.Error()) |
5618
|
|
|
} |
5619
|
|
|
return strings.Join(msgs, "; ") |
5620
|
|
|
} |
5621
|
|
|
|
5622
|
|
|
// AllErrors returns a list of validation violation errors. |
5623
|
|
|
func (m SchemaListRequestMultiError) AllErrors() []error { return m } |
5624
|
|
|
|
5625
|
|
|
// SchemaListRequestValidationError is the validation error returned by |
5626
|
|
|
// SchemaListRequest.Validate if the designated constraints aren't met. |
5627
|
|
|
type SchemaListRequestValidationError struct { |
5628
|
|
|
field string |
5629
|
|
|
reason string |
5630
|
|
|
cause error |
5631
|
|
|
key bool |
5632
|
|
|
} |
5633
|
|
|
|
5634
|
|
|
// Field function returns field value. |
5635
|
|
|
func (e SchemaListRequestValidationError) Field() string { return e.field } |
5636
|
|
|
|
5637
|
|
|
// Reason function returns reason value. |
5638
|
|
|
func (e SchemaListRequestValidationError) Reason() string { return e.reason } |
5639
|
|
|
|
5640
|
|
|
// Cause function returns cause value. |
5641
|
|
|
func (e SchemaListRequestValidationError) Cause() error { return e.cause } |
5642
|
|
|
|
5643
|
|
|
// Key function returns key value. |
5644
|
|
|
func (e SchemaListRequestValidationError) Key() bool { return e.key } |
5645
|
|
|
|
5646
|
|
|
// ErrorName returns error name. |
5647
|
|
|
func (e SchemaListRequestValidationError) ErrorName() string { |
5648
|
|
|
return "SchemaListRequestValidationError" |
5649
|
|
|
} |
5650
|
|
|
|
5651
|
|
|
// Error satisfies the builtin error interface |
5652
|
|
|
func (e SchemaListRequestValidationError) Error() string { |
5653
|
|
|
cause := "" |
5654
|
|
|
if e.cause != nil { |
5655
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5656
|
|
|
} |
5657
|
|
|
|
5658
|
|
|
key := "" |
5659
|
|
|
if e.key { |
5660
|
|
|
key = "key for " |
5661
|
|
|
} |
5662
|
|
|
|
5663
|
|
|
return fmt.Sprintf( |
5664
|
|
|
"invalid %sSchemaListRequest.%s: %s%s", |
5665
|
|
|
key, |
5666
|
|
|
e.field, |
5667
|
|
|
e.reason, |
5668
|
|
|
cause) |
5669
|
|
|
} |
5670
|
|
|
|
5671
|
|
|
var _ error = SchemaListRequestValidationError{} |
5672
|
|
|
|
5673
|
|
|
var _ interface { |
5674
|
|
|
Field() string |
5675
|
|
|
Reason() string |
5676
|
|
|
Key() bool |
5677
|
|
|
Cause() error |
5678
|
|
|
ErrorName() string |
5679
|
|
|
} = SchemaListRequestValidationError{} |
5680
|
|
|
|
5681
|
|
|
var _SchemaListRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
5682
|
|
|
|
5683
|
|
|
// Validate checks the field values on SchemaListResponse with the rules |
5684
|
|
|
// defined in the proto definition for this message. If any rules are |
5685
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5686
|
|
|
func (m *SchemaListResponse) Validate() error { |
5687
|
|
|
return m.validate(false) |
5688
|
|
|
} |
5689
|
|
|
|
5690
|
|
|
// ValidateAll checks the field values on SchemaListResponse with the rules |
5691
|
|
|
// defined in the proto definition for this message. If any rules are |
5692
|
|
|
// violated, the result is a list of violation errors wrapped in |
5693
|
|
|
// SchemaListResponseMultiError, or nil if none found. |
5694
|
|
|
func (m *SchemaListResponse) ValidateAll() error { |
5695
|
|
|
return m.validate(true) |
5696
|
|
|
} |
5697
|
|
|
|
5698
|
|
|
func (m *SchemaListResponse) validate(all bool) error { |
5699
|
|
|
if m == nil { |
5700
|
|
|
return nil |
5701
|
|
|
} |
5702
|
|
|
|
5703
|
|
|
var errors []error |
5704
|
|
|
|
5705
|
|
|
// no validation rules for Head |
5706
|
|
|
|
5707
|
|
|
for idx, item := range m.GetSchemas() { |
5708
|
|
|
_, _ = idx, item |
5709
|
|
|
|
5710
|
|
|
if all { |
5711
|
|
|
switch v := interface{}(item).(type) { |
5712
|
|
|
case interface{ ValidateAll() error }: |
5713
|
|
|
if err := v.ValidateAll(); err != nil { |
5714
|
|
|
errors = append(errors, SchemaListResponseValidationError{ |
5715
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
5716
|
|
|
reason: "embedded message failed validation", |
5717
|
|
|
cause: err, |
5718
|
|
|
}) |
5719
|
|
|
} |
5720
|
|
|
case interface{ Validate() error }: |
5721
|
|
|
if err := v.Validate(); err != nil { |
5722
|
|
|
errors = append(errors, SchemaListResponseValidationError{ |
5723
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
5724
|
|
|
reason: "embedded message failed validation", |
5725
|
|
|
cause: err, |
5726
|
|
|
}) |
5727
|
|
|
} |
5728
|
|
|
} |
5729
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
5730
|
|
|
if err := v.Validate(); err != nil { |
5731
|
|
|
return SchemaListResponseValidationError{ |
5732
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
5733
|
|
|
reason: "embedded message failed validation", |
5734
|
|
|
cause: err, |
5735
|
|
|
} |
5736
|
|
|
} |
5737
|
|
|
} |
5738
|
|
|
|
5739
|
|
|
} |
5740
|
|
|
|
5741
|
|
|
// no validation rules for ContinuousToken |
5742
|
|
|
|
5743
|
|
|
if len(errors) > 0 { |
5744
|
|
|
return SchemaListResponseMultiError(errors) |
5745
|
|
|
} |
5746
|
|
|
|
5747
|
|
|
return nil |
5748
|
|
|
} |
5749
|
|
|
|
5750
|
|
|
// SchemaListResponseMultiError is an error wrapping multiple validation errors |
5751
|
|
|
// returned by SchemaListResponse.ValidateAll() if the designated constraints |
5752
|
|
|
// aren't met. |
5753
|
|
|
type SchemaListResponseMultiError []error |
5754
|
|
|
|
5755
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5756
|
|
|
func (m SchemaListResponseMultiError) Error() string { |
5757
|
|
|
var msgs []string |
5758
|
|
|
for _, err := range m { |
5759
|
|
|
msgs = append(msgs, err.Error()) |
5760
|
|
|
} |
5761
|
|
|
return strings.Join(msgs, "; ") |
5762
|
|
|
} |
5763
|
|
|
|
5764
|
|
|
// AllErrors returns a list of validation violation errors. |
5765
|
|
|
func (m SchemaListResponseMultiError) AllErrors() []error { return m } |
5766
|
|
|
|
5767
|
|
|
// SchemaListResponseValidationError is the validation error returned by |
5768
|
|
|
// SchemaListResponse.Validate if the designated constraints aren't met. |
5769
|
|
|
type SchemaListResponseValidationError struct { |
5770
|
|
|
field string |
5771
|
|
|
reason string |
5772
|
|
|
cause error |
5773
|
|
|
key bool |
5774
|
|
|
} |
5775
|
|
|
|
5776
|
|
|
// Field function returns field value. |
5777
|
|
|
func (e SchemaListResponseValidationError) Field() string { return e.field } |
5778
|
|
|
|
5779
|
|
|
// Reason function returns reason value. |
5780
|
|
|
func (e SchemaListResponseValidationError) Reason() string { return e.reason } |
5781
|
|
|
|
5782
|
|
|
// Cause function returns cause value. |
5783
|
|
|
func (e SchemaListResponseValidationError) Cause() error { return e.cause } |
5784
|
|
|
|
5785
|
|
|
// Key function returns key value. |
5786
|
|
|
func (e SchemaListResponseValidationError) Key() bool { return e.key } |
5787
|
|
|
|
5788
|
|
|
// ErrorName returns error name. |
5789
|
|
|
func (e SchemaListResponseValidationError) ErrorName() string { |
5790
|
|
|
return "SchemaListResponseValidationError" |
5791
|
|
|
} |
5792
|
|
|
|
5793
|
|
|
// Error satisfies the builtin error interface |
5794
|
|
|
func (e SchemaListResponseValidationError) Error() string { |
5795
|
|
|
cause := "" |
5796
|
|
|
if e.cause != nil { |
5797
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5798
|
|
|
} |
5799
|
|
|
|
5800
|
|
|
key := "" |
5801
|
|
|
if e.key { |
5802
|
|
|
key = "key for " |
5803
|
|
|
} |
5804
|
|
|
|
5805
|
|
|
return fmt.Sprintf( |
5806
|
|
|
"invalid %sSchemaListResponse.%s: %s%s", |
5807
|
|
|
key, |
5808
|
|
|
e.field, |
5809
|
|
|
e.reason, |
5810
|
|
|
cause) |
5811
|
|
|
} |
5812
|
|
|
|
5813
|
|
|
var _ error = SchemaListResponseValidationError{} |
5814
|
|
|
|
5815
|
|
|
var _ interface { |
5816
|
|
|
Field() string |
5817
|
|
|
Reason() string |
5818
|
|
|
Key() bool |
5819
|
|
|
Cause() error |
5820
|
|
|
ErrorName() string |
5821
|
|
|
} = SchemaListResponseValidationError{} |
5822
|
|
|
|
5823
|
|
|
// Validate checks the field values on SchemaList with the rules defined in the |
5824
|
|
|
// proto definition for this message. If any rules are violated, the first |
5825
|
|
|
// error encountered is returned, or nil if there are no violations. |
5826
|
|
|
func (m *SchemaList) Validate() error { |
5827
|
|
|
return m.validate(false) |
5828
|
|
|
} |
5829
|
|
|
|
5830
|
|
|
// ValidateAll checks the field values on SchemaList with the rules defined in |
5831
|
|
|
// the proto definition for this message. If any rules are violated, the |
5832
|
|
|
// result is a list of violation errors wrapped in SchemaListMultiError, or |
5833
|
|
|
// nil if none found. |
5834
|
|
|
func (m *SchemaList) ValidateAll() error { |
5835
|
|
|
return m.validate(true) |
5836
|
|
|
} |
5837
|
|
|
|
5838
|
|
|
func (m *SchemaList) validate(all bool) error { |
5839
|
|
|
if m == nil { |
5840
|
|
|
return nil |
5841
|
|
|
} |
5842
|
|
|
|
5843
|
|
|
var errors []error |
5844
|
|
|
|
5845
|
|
|
// no validation rules for Version |
5846
|
|
|
|
5847
|
|
|
// no validation rules for CreatedAt |
5848
|
|
|
|
5849
|
|
|
if len(errors) > 0 { |
5850
|
|
|
return SchemaListMultiError(errors) |
5851
|
|
|
} |
5852
|
|
|
|
5853
|
|
|
return nil |
5854
|
|
|
} |
5855
|
|
|
|
5856
|
|
|
// SchemaListMultiError is an error wrapping multiple validation errors |
5857
|
|
|
// returned by SchemaList.ValidateAll() if the designated constraints aren't met. |
5858
|
|
|
type SchemaListMultiError []error |
5859
|
|
|
|
5860
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5861
|
|
|
func (m SchemaListMultiError) Error() string { |
5862
|
|
|
var msgs []string |
5863
|
|
|
for _, err := range m { |
5864
|
|
|
msgs = append(msgs, err.Error()) |
5865
|
|
|
} |
5866
|
|
|
return strings.Join(msgs, "; ") |
5867
|
|
|
} |
5868
|
|
|
|
5869
|
|
|
// AllErrors returns a list of validation violation errors. |
5870
|
|
|
func (m SchemaListMultiError) AllErrors() []error { return m } |
5871
|
|
|
|
5872
|
|
|
// SchemaListValidationError is the validation error returned by |
5873
|
|
|
// SchemaList.Validate if the designated constraints aren't met. |
5874
|
|
|
type SchemaListValidationError struct { |
5875
|
|
|
field string |
5876
|
|
|
reason string |
5877
|
|
|
cause error |
5878
|
|
|
key bool |
5879
|
|
|
} |
5880
|
|
|
|
5881
|
|
|
// Field function returns field value. |
5882
|
|
|
func (e SchemaListValidationError) Field() string { return e.field } |
5883
|
|
|
|
5884
|
|
|
// Reason function returns reason value. |
5885
|
|
|
func (e SchemaListValidationError) Reason() string { return e.reason } |
5886
|
|
|
|
5887
|
|
|
// Cause function returns cause value. |
5888
|
|
|
func (e SchemaListValidationError) Cause() error { return e.cause } |
5889
|
|
|
|
5890
|
|
|
// Key function returns key value. |
5891
|
|
|
func (e SchemaListValidationError) Key() bool { return e.key } |
5892
|
|
|
|
5893
|
|
|
// ErrorName returns error name. |
5894
|
|
|
func (e SchemaListValidationError) ErrorName() string { return "SchemaListValidationError" } |
5895
|
|
|
|
5896
|
|
|
// Error satisfies the builtin error interface |
5897
|
|
|
func (e SchemaListValidationError) Error() string { |
5898
|
|
|
cause := "" |
5899
|
|
|
if e.cause != nil { |
5900
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5901
|
|
|
} |
5902
|
|
|
|
5903
|
|
|
key := "" |
5904
|
|
|
if e.key { |
5905
|
|
|
key = "key for " |
5906
|
|
|
} |
5907
|
|
|
|
5908
|
|
|
return fmt.Sprintf( |
5909
|
|
|
"invalid %sSchemaList.%s: %s%s", |
5910
|
|
|
key, |
5911
|
|
|
e.field, |
5912
|
|
|
e.reason, |
5913
|
|
|
cause) |
5914
|
|
|
} |
5915
|
|
|
|
5916
|
|
|
var _ error = SchemaListValidationError{} |
5917
|
|
|
|
5918
|
|
|
var _ interface { |
5919
|
|
|
Field() string |
5920
|
|
|
Reason() string |
5921
|
|
|
Key() bool |
5922
|
|
|
Cause() error |
5923
|
|
|
ErrorName() string |
5924
|
|
|
} = SchemaListValidationError{} |
5925
|
|
|
|
5926
|
|
|
// Validate checks the field values on DataWriteRequest with the rules defined |
5927
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5928
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5929
|
|
|
func (m *DataWriteRequest) Validate() error { |
5930
|
|
|
return m.validate(false) |
5931
|
|
|
} |
5932
|
|
|
|
5933
|
|
|
// ValidateAll checks the field values on DataWriteRequest with the rules |
5934
|
|
|
// defined in the proto definition for this message. If any rules are |
5935
|
|
|
// violated, the result is a list of violation errors wrapped in |
5936
|
|
|
// DataWriteRequestMultiError, or nil if none found. |
5937
|
|
|
func (m *DataWriteRequest) ValidateAll() error { |
5938
|
|
|
return m.validate(true) |
5939
|
|
|
} |
5940
|
|
|
|
5941
|
|
|
func (m *DataWriteRequest) validate(all bool) error { |
5942
|
|
|
if m == nil { |
5943
|
|
|
return nil |
5944
|
|
|
} |
5945
|
|
|
|
5946
|
|
|
var errors []error |
5947
|
|
|
|
5948
|
|
|
if len(m.GetTenantId()) > 128 { |
5949
|
|
|
err := DataWriteRequestValidationError{ |
5950
|
|
|
field: "TenantId", |
5951
|
|
|
reason: "value length must be at most 128 bytes", |
5952
|
|
|
} |
5953
|
|
|
if !all { |
5954
|
|
|
return err |
5955
|
|
|
} |
5956
|
|
|
errors = append(errors, err) |
5957
|
|
|
} |
5958
|
|
|
|
5959
|
|
|
if !_DataWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5960
|
|
|
err := DataWriteRequestValidationError{ |
5961
|
|
|
field: "TenantId", |
5962
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5963
|
|
|
} |
5964
|
|
|
if !all { |
5965
|
|
|
return err |
5966
|
|
|
} |
5967
|
|
|
errors = append(errors, err) |
5968
|
|
|
} |
5969
|
|
|
|
5970
|
|
|
if m.GetMetadata() == nil { |
5971
|
|
|
err := DataWriteRequestValidationError{ |
5972
|
|
|
field: "Metadata", |
5973
|
|
|
reason: "value is required", |
5974
|
|
|
} |
5975
|
|
|
if !all { |
5976
|
|
|
return err |
5977
|
|
|
} |
5978
|
|
|
errors = append(errors, err) |
5979
|
|
|
} |
5980
|
|
|
|
5981
|
|
|
if all { |
5982
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
5983
|
|
|
case interface{ ValidateAll() error }: |
5984
|
|
|
if err := v.ValidateAll(); err != nil { |
5985
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5986
|
|
|
field: "Metadata", |
5987
|
|
|
reason: "embedded message failed validation", |
5988
|
|
|
cause: err, |
5989
|
|
|
}) |
5990
|
|
|
} |
5991
|
|
|
case interface{ Validate() error }: |
5992
|
|
|
if err := v.Validate(); err != nil { |
5993
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5994
|
|
|
field: "Metadata", |
5995
|
|
|
reason: "embedded message failed validation", |
5996
|
|
|
cause: err, |
5997
|
|
|
}) |
5998
|
|
|
} |
5999
|
|
|
} |
6000
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6001
|
|
|
if err := v.Validate(); err != nil { |
6002
|
|
|
return DataWriteRequestValidationError{ |
6003
|
|
|
field: "Metadata", |
6004
|
|
|
reason: "embedded message failed validation", |
6005
|
|
|
cause: err, |
6006
|
|
|
} |
6007
|
|
|
} |
6008
|
|
|
} |
6009
|
|
|
|
6010
|
|
|
if len(m.GetTuples()) > 100 { |
6011
|
|
|
err := DataWriteRequestValidationError{ |
6012
|
|
|
field: "Tuples", |
6013
|
|
|
reason: "value must contain no more than 100 item(s)", |
6014
|
|
|
} |
6015
|
|
|
if !all { |
6016
|
|
|
return err |
6017
|
|
|
} |
6018
|
|
|
errors = append(errors, err) |
6019
|
|
|
} |
6020
|
|
|
|
6021
|
|
|
for idx, item := range m.GetTuples() { |
6022
|
|
|
_, _ = idx, item |
6023
|
|
|
|
6024
|
|
|
if item == nil { |
6025
|
|
|
err := DataWriteRequestValidationError{ |
6026
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6027
|
|
|
reason: "value is required", |
6028
|
|
|
} |
6029
|
|
|
if !all { |
6030
|
|
|
return err |
6031
|
|
|
} |
6032
|
|
|
errors = append(errors, err) |
6033
|
|
|
} |
6034
|
|
|
|
6035
|
|
|
if all { |
6036
|
|
|
switch v := interface{}(item).(type) { |
6037
|
|
|
case interface{ ValidateAll() error }: |
6038
|
|
|
if err := v.ValidateAll(); err != nil { |
6039
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
6040
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6041
|
|
|
reason: "embedded message failed validation", |
6042
|
|
|
cause: err, |
6043
|
|
|
}) |
6044
|
|
|
} |
6045
|
|
|
case interface{ Validate() error }: |
6046
|
|
|
if err := v.Validate(); err != nil { |
6047
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
6048
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6049
|
|
|
reason: "embedded message failed validation", |
6050
|
|
|
cause: err, |
6051
|
|
|
}) |
6052
|
|
|
} |
6053
|
|
|
} |
6054
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6055
|
|
|
if err := v.Validate(); err != nil { |
6056
|
|
|
return DataWriteRequestValidationError{ |
6057
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6058
|
|
|
reason: "embedded message failed validation", |
6059
|
|
|
cause: err, |
6060
|
|
|
} |
6061
|
|
|
} |
6062
|
|
|
} |
6063
|
|
|
|
6064
|
|
|
} |
6065
|
|
|
|
6066
|
|
|
if len(m.GetAttributes()) > 100 { |
6067
|
|
|
err := DataWriteRequestValidationError{ |
6068
|
|
|
field: "Attributes", |
6069
|
|
|
reason: "value must contain no more than 100 item(s)", |
6070
|
|
|
} |
6071
|
|
|
if !all { |
6072
|
|
|
return err |
6073
|
|
|
} |
6074
|
|
|
errors = append(errors, err) |
6075
|
|
|
} |
6076
|
|
|
|
6077
|
|
|
for idx, item := range m.GetAttributes() { |
6078
|
|
|
_, _ = idx, item |
6079
|
|
|
|
6080
|
|
|
if item == nil { |
6081
|
|
|
err := DataWriteRequestValidationError{ |
6082
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6083
|
|
|
reason: "value is required", |
6084
|
|
|
} |
6085
|
|
|
if !all { |
6086
|
|
|
return err |
6087
|
|
|
} |
6088
|
|
|
errors = append(errors, err) |
6089
|
|
|
} |
6090
|
|
|
|
6091
|
|
|
if all { |
6092
|
|
|
switch v := interface{}(item).(type) { |
6093
|
|
|
case interface{ ValidateAll() error }: |
6094
|
|
|
if err := v.ValidateAll(); err != nil { |
6095
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
6096
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6097
|
|
|
reason: "embedded message failed validation", |
6098
|
|
|
cause: err, |
6099
|
|
|
}) |
6100
|
|
|
} |
6101
|
|
|
case interface{ Validate() error }: |
6102
|
|
|
if err := v.Validate(); err != nil { |
6103
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
6104
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6105
|
|
|
reason: "embedded message failed validation", |
6106
|
|
|
cause: err, |
6107
|
|
|
}) |
6108
|
|
|
} |
6109
|
|
|
} |
6110
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6111
|
|
|
if err := v.Validate(); err != nil { |
6112
|
|
|
return DataWriteRequestValidationError{ |
6113
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6114
|
|
|
reason: "embedded message failed validation", |
6115
|
|
|
cause: err, |
6116
|
|
|
} |
6117
|
|
|
} |
6118
|
|
|
} |
6119
|
|
|
|
6120
|
|
|
} |
6121
|
|
|
|
6122
|
|
|
if len(errors) > 0 { |
6123
|
|
|
return DataWriteRequestMultiError(errors) |
6124
|
|
|
} |
6125
|
|
|
|
6126
|
|
|
return nil |
6127
|
|
|
} |
6128
|
|
|
|
6129
|
|
|
// DataWriteRequestMultiError is an error wrapping multiple validation errors |
6130
|
|
|
// returned by DataWriteRequest.ValidateAll() if the designated constraints |
6131
|
|
|
// aren't met. |
6132
|
|
|
type DataWriteRequestMultiError []error |
6133
|
|
|
|
6134
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6135
|
|
|
func (m DataWriteRequestMultiError) Error() string { |
6136
|
|
|
var msgs []string |
6137
|
|
|
for _, err := range m { |
6138
|
|
|
msgs = append(msgs, err.Error()) |
6139
|
|
|
} |
6140
|
|
|
return strings.Join(msgs, "; ") |
6141
|
|
|
} |
6142
|
|
|
|
6143
|
|
|
// AllErrors returns a list of validation violation errors. |
6144
|
|
|
func (m DataWriteRequestMultiError) AllErrors() []error { return m } |
6145
|
|
|
|
6146
|
|
|
// DataWriteRequestValidationError is the validation error returned by |
6147
|
|
|
// DataWriteRequest.Validate if the designated constraints aren't met. |
6148
|
|
|
type DataWriteRequestValidationError struct { |
6149
|
|
|
field string |
6150
|
|
|
reason string |
6151
|
|
|
cause error |
6152
|
|
|
key bool |
6153
|
|
|
} |
6154
|
|
|
|
6155
|
|
|
// Field function returns field value. |
6156
|
|
|
func (e DataWriteRequestValidationError) Field() string { return e.field } |
6157
|
|
|
|
6158
|
|
|
// Reason function returns reason value. |
6159
|
|
|
func (e DataWriteRequestValidationError) Reason() string { return e.reason } |
6160
|
|
|
|
6161
|
|
|
// Cause function returns cause value. |
6162
|
|
|
func (e DataWriteRequestValidationError) Cause() error { return e.cause } |
6163
|
|
|
|
6164
|
|
|
// Key function returns key value. |
6165
|
|
|
func (e DataWriteRequestValidationError) Key() bool { return e.key } |
6166
|
|
|
|
6167
|
|
|
// ErrorName returns error name. |
6168
|
|
|
func (e DataWriteRequestValidationError) ErrorName() string { return "DataWriteRequestValidationError" } |
6169
|
|
|
|
6170
|
|
|
// Error satisfies the builtin error interface |
6171
|
|
|
func (e DataWriteRequestValidationError) Error() string { |
6172
|
|
|
cause := "" |
6173
|
|
|
if e.cause != nil { |
6174
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6175
|
|
|
} |
6176
|
|
|
|
6177
|
|
|
key := "" |
6178
|
|
|
if e.key { |
6179
|
|
|
key = "key for " |
6180
|
|
|
} |
6181
|
|
|
|
6182
|
|
|
return fmt.Sprintf( |
6183
|
|
|
"invalid %sDataWriteRequest.%s: %s%s", |
6184
|
|
|
key, |
6185
|
|
|
e.field, |
6186
|
|
|
e.reason, |
6187
|
|
|
cause) |
6188
|
|
|
} |
6189
|
|
|
|
6190
|
|
|
var _ error = DataWriteRequestValidationError{} |
6191
|
|
|
|
6192
|
|
|
var _ interface { |
6193
|
|
|
Field() string |
6194
|
|
|
Reason() string |
6195
|
|
|
Key() bool |
6196
|
|
|
Cause() error |
6197
|
|
|
ErrorName() string |
6198
|
|
|
} = DataWriteRequestValidationError{} |
6199
|
|
|
|
6200
|
|
|
var _DataWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6201
|
|
|
|
6202
|
|
|
// Validate checks the field values on DataWriteRequestMetadata with the rules |
6203
|
|
|
// defined in the proto definition for this message. If any rules are |
6204
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6205
|
|
|
func (m *DataWriteRequestMetadata) Validate() error { |
6206
|
|
|
return m.validate(false) |
6207
|
|
|
} |
6208
|
|
|
|
6209
|
|
|
// ValidateAll checks the field values on DataWriteRequestMetadata with the |
6210
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6211
|
|
|
// violated, the result is a list of violation errors wrapped in |
6212
|
|
|
// DataWriteRequestMetadataMultiError, or nil if none found. |
6213
|
|
|
func (m *DataWriteRequestMetadata) ValidateAll() error { |
6214
|
|
|
return m.validate(true) |
6215
|
|
|
} |
6216
|
|
|
|
6217
|
|
|
func (m *DataWriteRequestMetadata) validate(all bool) error { |
6218
|
|
|
if m == nil { |
6219
|
|
|
return nil |
6220
|
|
|
} |
6221
|
|
|
|
6222
|
|
|
var errors []error |
6223
|
|
|
|
6224
|
|
|
// no validation rules for SchemaVersion |
6225
|
|
|
|
6226
|
|
|
if len(errors) > 0 { |
6227
|
|
|
return DataWriteRequestMetadataMultiError(errors) |
6228
|
|
|
} |
6229
|
|
|
|
6230
|
|
|
return nil |
6231
|
|
|
} |
6232
|
|
|
|
6233
|
|
|
// DataWriteRequestMetadataMultiError is an error wrapping multiple validation |
6234
|
|
|
// errors returned by DataWriteRequestMetadata.ValidateAll() if the designated |
6235
|
|
|
// constraints aren't met. |
6236
|
|
|
type DataWriteRequestMetadataMultiError []error |
6237
|
|
|
|
6238
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6239
|
|
|
func (m DataWriteRequestMetadataMultiError) Error() string { |
6240
|
|
|
var msgs []string |
6241
|
|
|
for _, err := range m { |
6242
|
|
|
msgs = append(msgs, err.Error()) |
6243
|
|
|
} |
6244
|
|
|
return strings.Join(msgs, "; ") |
6245
|
|
|
} |
6246
|
|
|
|
6247
|
|
|
// AllErrors returns a list of validation violation errors. |
6248
|
|
|
func (m DataWriteRequestMetadataMultiError) AllErrors() []error { return m } |
6249
|
|
|
|
6250
|
|
|
// DataWriteRequestMetadataValidationError is the validation error returned by |
6251
|
|
|
// DataWriteRequestMetadata.Validate if the designated constraints aren't met. |
6252
|
|
|
type DataWriteRequestMetadataValidationError struct { |
6253
|
|
|
field string |
6254
|
|
|
reason string |
6255
|
|
|
cause error |
6256
|
|
|
key bool |
6257
|
|
|
} |
6258
|
|
|
|
6259
|
|
|
// Field function returns field value. |
6260
|
|
|
func (e DataWriteRequestMetadataValidationError) Field() string { return e.field } |
6261
|
|
|
|
6262
|
|
|
// Reason function returns reason value. |
6263
|
|
|
func (e DataWriteRequestMetadataValidationError) Reason() string { return e.reason } |
6264
|
|
|
|
6265
|
|
|
// Cause function returns cause value. |
6266
|
|
|
func (e DataWriteRequestMetadataValidationError) Cause() error { return e.cause } |
6267
|
|
|
|
6268
|
|
|
// Key function returns key value. |
6269
|
|
|
func (e DataWriteRequestMetadataValidationError) Key() bool { return e.key } |
6270
|
|
|
|
6271
|
|
|
// ErrorName returns error name. |
6272
|
|
|
func (e DataWriteRequestMetadataValidationError) ErrorName() string { |
6273
|
|
|
return "DataWriteRequestMetadataValidationError" |
6274
|
|
|
} |
6275
|
|
|
|
6276
|
|
|
// Error satisfies the builtin error interface |
6277
|
|
|
func (e DataWriteRequestMetadataValidationError) Error() string { |
6278
|
|
|
cause := "" |
6279
|
|
|
if e.cause != nil { |
6280
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6281
|
|
|
} |
6282
|
|
|
|
6283
|
|
|
key := "" |
6284
|
|
|
if e.key { |
6285
|
|
|
key = "key for " |
6286
|
|
|
} |
6287
|
|
|
|
6288
|
|
|
return fmt.Sprintf( |
6289
|
|
|
"invalid %sDataWriteRequestMetadata.%s: %s%s", |
6290
|
|
|
key, |
6291
|
|
|
e.field, |
6292
|
|
|
e.reason, |
6293
|
|
|
cause) |
6294
|
|
|
} |
6295
|
|
|
|
6296
|
|
|
var _ error = DataWriteRequestMetadataValidationError{} |
6297
|
|
|
|
6298
|
|
|
var _ interface { |
6299
|
|
|
Field() string |
6300
|
|
|
Reason() string |
6301
|
|
|
Key() bool |
6302
|
|
|
Cause() error |
6303
|
|
|
ErrorName() string |
6304
|
|
|
} = DataWriteRequestMetadataValidationError{} |
6305
|
|
|
|
6306
|
|
|
// Validate checks the field values on DataWriteResponse with the rules defined |
6307
|
|
|
// in the proto definition for this message. If any rules are violated, the |
6308
|
|
|
// first error encountered is returned, or nil if there are no violations. |
6309
|
|
|
func (m *DataWriteResponse) Validate() error { |
6310
|
|
|
return m.validate(false) |
6311
|
|
|
} |
6312
|
|
|
|
6313
|
|
|
// ValidateAll checks the field values on DataWriteResponse with the rules |
6314
|
|
|
// defined in the proto definition for this message. If any rules are |
6315
|
|
|
// violated, the result is a list of violation errors wrapped in |
6316
|
|
|
// DataWriteResponseMultiError, or nil if none found. |
6317
|
|
|
func (m *DataWriteResponse) ValidateAll() error { |
6318
|
|
|
return m.validate(true) |
6319
|
|
|
} |
6320
|
|
|
|
6321
|
|
|
func (m *DataWriteResponse) validate(all bool) error { |
6322
|
|
|
if m == nil { |
6323
|
|
|
return nil |
6324
|
|
|
} |
6325
|
|
|
|
6326
|
|
|
var errors []error |
6327
|
|
|
|
6328
|
|
|
// no validation rules for SnapToken |
6329
|
|
|
|
6330
|
|
|
if len(errors) > 0 { |
6331
|
|
|
return DataWriteResponseMultiError(errors) |
6332
|
|
|
} |
6333
|
|
|
|
6334
|
|
|
return nil |
6335
|
|
|
} |
6336
|
|
|
|
6337
|
|
|
// DataWriteResponseMultiError is an error wrapping multiple validation errors |
6338
|
|
|
// returned by DataWriteResponse.ValidateAll() if the designated constraints |
6339
|
|
|
// aren't met. |
6340
|
|
|
type DataWriteResponseMultiError []error |
6341
|
|
|
|
6342
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6343
|
|
|
func (m DataWriteResponseMultiError) Error() string { |
6344
|
|
|
var msgs []string |
6345
|
|
|
for _, err := range m { |
6346
|
|
|
msgs = append(msgs, err.Error()) |
6347
|
|
|
} |
6348
|
|
|
return strings.Join(msgs, "; ") |
6349
|
|
|
} |
6350
|
|
|
|
6351
|
|
|
// AllErrors returns a list of validation violation errors. |
6352
|
|
|
func (m DataWriteResponseMultiError) AllErrors() []error { return m } |
6353
|
|
|
|
6354
|
|
|
// DataWriteResponseValidationError is the validation error returned by |
6355
|
|
|
// DataWriteResponse.Validate if the designated constraints aren't met. |
6356
|
|
|
type DataWriteResponseValidationError struct { |
6357
|
|
|
field string |
6358
|
|
|
reason string |
6359
|
|
|
cause error |
6360
|
|
|
key bool |
6361
|
|
|
} |
6362
|
|
|
|
6363
|
|
|
// Field function returns field value. |
6364
|
|
|
func (e DataWriteResponseValidationError) Field() string { return e.field } |
6365
|
|
|
|
6366
|
|
|
// Reason function returns reason value. |
6367
|
|
|
func (e DataWriteResponseValidationError) Reason() string { return e.reason } |
6368
|
|
|
|
6369
|
|
|
// Cause function returns cause value. |
6370
|
|
|
func (e DataWriteResponseValidationError) Cause() error { return e.cause } |
6371
|
|
|
|
6372
|
|
|
// Key function returns key value. |
6373
|
|
|
func (e DataWriteResponseValidationError) Key() bool { return e.key } |
6374
|
|
|
|
6375
|
|
|
// ErrorName returns error name. |
6376
|
|
|
func (e DataWriteResponseValidationError) ErrorName() string { |
6377
|
|
|
return "DataWriteResponseValidationError" |
6378
|
|
|
} |
6379
|
|
|
|
6380
|
|
|
// Error satisfies the builtin error interface |
6381
|
|
|
func (e DataWriteResponseValidationError) Error() string { |
6382
|
|
|
cause := "" |
6383
|
|
|
if e.cause != nil { |
6384
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6385
|
|
|
} |
6386
|
|
|
|
6387
|
|
|
key := "" |
6388
|
|
|
if e.key { |
6389
|
|
|
key = "key for " |
6390
|
|
|
} |
6391
|
|
|
|
6392
|
|
|
return fmt.Sprintf( |
6393
|
|
|
"invalid %sDataWriteResponse.%s: %s%s", |
6394
|
|
|
key, |
6395
|
|
|
e.field, |
6396
|
|
|
e.reason, |
6397
|
|
|
cause) |
6398
|
|
|
} |
6399
|
|
|
|
6400
|
|
|
var _ error = DataWriteResponseValidationError{} |
6401
|
|
|
|
6402
|
|
|
var _ interface { |
6403
|
|
|
Field() string |
6404
|
|
|
Reason() string |
6405
|
|
|
Key() bool |
6406
|
|
|
Cause() error |
6407
|
|
|
ErrorName() string |
6408
|
|
|
} = DataWriteResponseValidationError{} |
6409
|
|
|
|
6410
|
|
|
// Validate checks the field values on RelationshipWriteRequest with the rules |
6411
|
|
|
// defined in the proto definition for this message. If any rules are |
6412
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6413
|
|
|
func (m *RelationshipWriteRequest) Validate() error { |
6414
|
|
|
return m.validate(false) |
6415
|
|
|
} |
6416
|
|
|
|
6417
|
|
|
// ValidateAll checks the field values on RelationshipWriteRequest with the |
6418
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6419
|
|
|
// violated, the result is a list of violation errors wrapped in |
6420
|
|
|
// RelationshipWriteRequestMultiError, or nil if none found. |
6421
|
|
|
func (m *RelationshipWriteRequest) ValidateAll() error { |
6422
|
|
|
return m.validate(true) |
6423
|
|
|
} |
6424
|
|
|
|
6425
|
|
|
func (m *RelationshipWriteRequest) validate(all bool) error { |
6426
|
|
|
if m == nil { |
6427
|
|
|
return nil |
6428
|
|
|
} |
6429
|
|
|
|
6430
|
|
|
var errors []error |
6431
|
|
|
|
6432
|
|
|
if len(m.GetTenantId()) > 128 { |
6433
|
|
|
err := RelationshipWriteRequestValidationError{ |
6434
|
|
|
field: "TenantId", |
6435
|
|
|
reason: "value length must be at most 128 bytes", |
6436
|
|
|
} |
6437
|
|
|
if !all { |
6438
|
|
|
return err |
6439
|
|
|
} |
6440
|
|
|
errors = append(errors, err) |
6441
|
|
|
} |
6442
|
|
|
|
6443
|
|
|
if !_RelationshipWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
6444
|
|
|
err := RelationshipWriteRequestValidationError{ |
6445
|
|
|
field: "TenantId", |
6446
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
6447
|
|
|
} |
6448
|
|
|
if !all { |
6449
|
|
|
return err |
6450
|
|
|
} |
6451
|
|
|
errors = append(errors, err) |
6452
|
|
|
} |
6453
|
|
|
|
6454
|
|
|
if m.GetMetadata() == nil { |
6455
|
|
|
err := RelationshipWriteRequestValidationError{ |
6456
|
|
|
field: "Metadata", |
6457
|
|
|
reason: "value is required", |
6458
|
|
|
} |
6459
|
|
|
if !all { |
6460
|
|
|
return err |
6461
|
|
|
} |
6462
|
|
|
errors = append(errors, err) |
6463
|
|
|
} |
6464
|
|
|
|
6465
|
|
|
if all { |
6466
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
6467
|
|
|
case interface{ ValidateAll() error }: |
6468
|
|
|
if err := v.ValidateAll(); err != nil { |
6469
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6470
|
|
|
field: "Metadata", |
6471
|
|
|
reason: "embedded message failed validation", |
6472
|
|
|
cause: err, |
6473
|
|
|
}) |
6474
|
|
|
} |
6475
|
|
|
case interface{ Validate() error }: |
6476
|
|
|
if err := v.Validate(); err != nil { |
6477
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6478
|
|
|
field: "Metadata", |
6479
|
|
|
reason: "embedded message failed validation", |
6480
|
|
|
cause: err, |
6481
|
|
|
}) |
6482
|
|
|
} |
6483
|
|
|
} |
6484
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6485
|
|
|
if err := v.Validate(); err != nil { |
6486
|
|
|
return RelationshipWriteRequestValidationError{ |
6487
|
|
|
field: "Metadata", |
6488
|
|
|
reason: "embedded message failed validation", |
6489
|
|
|
cause: err, |
6490
|
|
|
} |
6491
|
|
|
} |
6492
|
|
|
} |
6493
|
|
|
|
6494
|
|
|
if l := len(m.GetTuples()); l < 1 || l > 100 { |
6495
|
|
|
err := RelationshipWriteRequestValidationError{ |
6496
|
|
|
field: "Tuples", |
6497
|
|
|
reason: "value must contain between 1 and 100 items, inclusive", |
6498
|
|
|
} |
6499
|
|
|
if !all { |
6500
|
|
|
return err |
6501
|
|
|
} |
6502
|
|
|
errors = append(errors, err) |
6503
|
|
|
} |
6504
|
|
|
|
6505
|
|
|
for idx, item := range m.GetTuples() { |
6506
|
|
|
_, _ = idx, item |
6507
|
|
|
|
6508
|
|
|
if item == nil { |
6509
|
|
|
err := RelationshipWriteRequestValidationError{ |
6510
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6511
|
|
|
reason: "value is required", |
6512
|
|
|
} |
6513
|
|
|
if !all { |
6514
|
|
|
return err |
6515
|
|
|
} |
6516
|
|
|
errors = append(errors, err) |
6517
|
|
|
} |
6518
|
|
|
|
6519
|
|
|
if all { |
6520
|
|
|
switch v := interface{}(item).(type) { |
6521
|
|
|
case interface{ ValidateAll() error }: |
6522
|
|
|
if err := v.ValidateAll(); err != nil { |
6523
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6524
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6525
|
|
|
reason: "embedded message failed validation", |
6526
|
|
|
cause: err, |
6527
|
|
|
}) |
6528
|
|
|
} |
6529
|
|
|
case interface{ Validate() error }: |
6530
|
|
|
if err := v.Validate(); err != nil { |
6531
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
6532
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6533
|
|
|
reason: "embedded message failed validation", |
6534
|
|
|
cause: err, |
6535
|
|
|
}) |
6536
|
|
|
} |
6537
|
|
|
} |
6538
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6539
|
|
|
if err := v.Validate(); err != nil { |
6540
|
|
|
return RelationshipWriteRequestValidationError{ |
6541
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6542
|
|
|
reason: "embedded message failed validation", |
6543
|
|
|
cause: err, |
6544
|
|
|
} |
6545
|
|
|
} |
6546
|
|
|
} |
6547
|
|
|
|
6548
|
|
|
} |
6549
|
|
|
|
6550
|
|
|
if len(errors) > 0 { |
6551
|
|
|
return RelationshipWriteRequestMultiError(errors) |
6552
|
|
|
} |
6553
|
|
|
|
6554
|
|
|
return nil |
6555
|
|
|
} |
6556
|
|
|
|
6557
|
|
|
// RelationshipWriteRequestMultiError is an error wrapping multiple validation |
6558
|
|
|
// errors returned by RelationshipWriteRequest.ValidateAll() if the designated |
6559
|
|
|
// constraints aren't met. |
6560
|
|
|
type RelationshipWriteRequestMultiError []error |
6561
|
|
|
|
6562
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6563
|
|
|
func (m RelationshipWriteRequestMultiError) Error() string { |
6564
|
|
|
var msgs []string |
6565
|
|
|
for _, err := range m { |
6566
|
|
|
msgs = append(msgs, err.Error()) |
6567
|
|
|
} |
6568
|
|
|
return strings.Join(msgs, "; ") |
6569
|
|
|
} |
6570
|
|
|
|
6571
|
|
|
// AllErrors returns a list of validation violation errors. |
6572
|
|
|
func (m RelationshipWriteRequestMultiError) AllErrors() []error { return m } |
6573
|
|
|
|
6574
|
|
|
// RelationshipWriteRequestValidationError is the validation error returned by |
6575
|
|
|
// RelationshipWriteRequest.Validate if the designated constraints aren't met. |
6576
|
|
|
type RelationshipWriteRequestValidationError struct { |
6577
|
|
|
field string |
6578
|
|
|
reason string |
6579
|
|
|
cause error |
6580
|
|
|
key bool |
6581
|
|
|
} |
6582
|
|
|
|
6583
|
|
|
// Field function returns field value. |
6584
|
|
|
func (e RelationshipWriteRequestValidationError) Field() string { return e.field } |
6585
|
|
|
|
6586
|
|
|
// Reason function returns reason value. |
6587
|
|
|
func (e RelationshipWriteRequestValidationError) Reason() string { return e.reason } |
6588
|
|
|
|
6589
|
|
|
// Cause function returns cause value. |
6590
|
|
|
func (e RelationshipWriteRequestValidationError) Cause() error { return e.cause } |
6591
|
|
|
|
6592
|
|
|
// Key function returns key value. |
6593
|
|
|
func (e RelationshipWriteRequestValidationError) Key() bool { return e.key } |
6594
|
|
|
|
6595
|
|
|
// ErrorName returns error name. |
6596
|
|
|
func (e RelationshipWriteRequestValidationError) ErrorName() string { |
6597
|
|
|
return "RelationshipWriteRequestValidationError" |
6598
|
|
|
} |
6599
|
|
|
|
6600
|
|
|
// Error satisfies the builtin error interface |
6601
|
|
|
func (e RelationshipWriteRequestValidationError) Error() string { |
6602
|
|
|
cause := "" |
6603
|
|
|
if e.cause != nil { |
6604
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6605
|
|
|
} |
6606
|
|
|
|
6607
|
|
|
key := "" |
6608
|
|
|
if e.key { |
6609
|
|
|
key = "key for " |
6610
|
|
|
} |
6611
|
|
|
|
6612
|
|
|
return fmt.Sprintf( |
6613
|
|
|
"invalid %sRelationshipWriteRequest.%s: %s%s", |
6614
|
|
|
key, |
6615
|
|
|
e.field, |
6616
|
|
|
e.reason, |
6617
|
|
|
cause) |
6618
|
|
|
} |
6619
|
|
|
|
6620
|
|
|
var _ error = RelationshipWriteRequestValidationError{} |
6621
|
|
|
|
6622
|
|
|
var _ interface { |
6623
|
|
|
Field() string |
6624
|
|
|
Reason() string |
6625
|
|
|
Key() bool |
6626
|
|
|
Cause() error |
6627
|
|
|
ErrorName() string |
6628
|
|
|
} = RelationshipWriteRequestValidationError{} |
6629
|
|
|
|
6630
|
|
|
var _RelationshipWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6631
|
|
|
|
6632
|
|
|
// Validate checks the field values on RelationshipWriteRequestMetadata with |
6633
|
|
|
// the rules defined in the proto definition for this message. If any rules |
6634
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
6635
|
|
|
// no violations. |
6636
|
|
|
func (m *RelationshipWriteRequestMetadata) Validate() error { |
6637
|
|
|
return m.validate(false) |
6638
|
|
|
} |
6639
|
|
|
|
6640
|
|
|
// ValidateAll checks the field values on RelationshipWriteRequestMetadata with |
6641
|
|
|
// the rules defined in the proto definition for this message. If any rules |
6642
|
|
|
// are violated, the result is a list of violation errors wrapped in |
6643
|
|
|
// RelationshipWriteRequestMetadataMultiError, or nil if none found. |
6644
|
|
|
func (m *RelationshipWriteRequestMetadata) ValidateAll() error { |
6645
|
|
|
return m.validate(true) |
6646
|
|
|
} |
6647
|
|
|
|
6648
|
|
|
func (m *RelationshipWriteRequestMetadata) validate(all bool) error { |
6649
|
|
|
if m == nil { |
6650
|
|
|
return nil |
6651
|
|
|
} |
6652
|
|
|
|
6653
|
|
|
var errors []error |
6654
|
|
|
|
6655
|
|
|
// no validation rules for SchemaVersion |
6656
|
|
|
|
6657
|
|
|
if len(errors) > 0 { |
6658
|
|
|
return RelationshipWriteRequestMetadataMultiError(errors) |
6659
|
|
|
} |
6660
|
|
|
|
6661
|
|
|
return nil |
6662
|
|
|
} |
6663
|
|
|
|
6664
|
|
|
// RelationshipWriteRequestMetadataMultiError is an error wrapping multiple |
6665
|
|
|
// validation errors returned by |
6666
|
|
|
// RelationshipWriteRequestMetadata.ValidateAll() if the designated |
6667
|
|
|
// constraints aren't met. |
6668
|
|
|
type RelationshipWriteRequestMetadataMultiError []error |
6669
|
|
|
|
6670
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6671
|
|
|
func (m RelationshipWriteRequestMetadataMultiError) Error() string { |
6672
|
|
|
var msgs []string |
6673
|
|
|
for _, err := range m { |
6674
|
|
|
msgs = append(msgs, err.Error()) |
6675
|
|
|
} |
6676
|
|
|
return strings.Join(msgs, "; ") |
6677
|
|
|
} |
6678
|
|
|
|
6679
|
|
|
// AllErrors returns a list of validation violation errors. |
6680
|
|
|
func (m RelationshipWriteRequestMetadataMultiError) AllErrors() []error { return m } |
6681
|
|
|
|
6682
|
|
|
// RelationshipWriteRequestMetadataValidationError is the validation error |
6683
|
|
|
// returned by RelationshipWriteRequestMetadata.Validate if the designated |
6684
|
|
|
// constraints aren't met. |
6685
|
|
|
type RelationshipWriteRequestMetadataValidationError struct { |
6686
|
|
|
field string |
6687
|
|
|
reason string |
6688
|
|
|
cause error |
6689
|
|
|
key bool |
6690
|
|
|
} |
6691
|
|
|
|
6692
|
|
|
// Field function returns field value. |
6693
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Field() string { return e.field } |
6694
|
|
|
|
6695
|
|
|
// Reason function returns reason value. |
6696
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Reason() string { return e.reason } |
6697
|
|
|
|
6698
|
|
|
// Cause function returns cause value. |
6699
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Cause() error { return e.cause } |
6700
|
|
|
|
6701
|
|
|
// Key function returns key value. |
6702
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Key() bool { return e.key } |
6703
|
|
|
|
6704
|
|
|
// ErrorName returns error name. |
6705
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) ErrorName() string { |
6706
|
|
|
return "RelationshipWriteRequestMetadataValidationError" |
6707
|
|
|
} |
6708
|
|
|
|
6709
|
|
|
// Error satisfies the builtin error interface |
6710
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Error() string { |
6711
|
|
|
cause := "" |
6712
|
|
|
if e.cause != nil { |
6713
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6714
|
|
|
} |
6715
|
|
|
|
6716
|
|
|
key := "" |
6717
|
|
|
if e.key { |
6718
|
|
|
key = "key for " |
6719
|
|
|
} |
6720
|
|
|
|
6721
|
|
|
return fmt.Sprintf( |
6722
|
|
|
"invalid %sRelationshipWriteRequestMetadata.%s: %s%s", |
6723
|
|
|
key, |
6724
|
|
|
e.field, |
6725
|
|
|
e.reason, |
6726
|
|
|
cause) |
6727
|
|
|
} |
6728
|
|
|
|
6729
|
|
|
var _ error = RelationshipWriteRequestMetadataValidationError{} |
6730
|
|
|
|
6731
|
|
|
var _ interface { |
6732
|
|
|
Field() string |
6733
|
|
|
Reason() string |
6734
|
|
|
Key() bool |
6735
|
|
|
Cause() error |
6736
|
|
|
ErrorName() string |
6737
|
|
|
} = RelationshipWriteRequestMetadataValidationError{} |
6738
|
|
|
|
6739
|
|
|
// Validate checks the field values on RelationshipWriteResponse with the rules |
6740
|
|
|
// defined in the proto definition for this message. If any rules are |
6741
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6742
|
|
|
func (m *RelationshipWriteResponse) Validate() error { |
6743
|
|
|
return m.validate(false) |
6744
|
|
|
} |
6745
|
|
|
|
6746
|
|
|
// ValidateAll checks the field values on RelationshipWriteResponse with the |
6747
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6748
|
|
|
// violated, the result is a list of violation errors wrapped in |
6749
|
|
|
// RelationshipWriteResponseMultiError, or nil if none found. |
6750
|
|
|
func (m *RelationshipWriteResponse) ValidateAll() error { |
6751
|
|
|
return m.validate(true) |
6752
|
|
|
} |
6753
|
|
|
|
6754
|
|
|
func (m *RelationshipWriteResponse) validate(all bool) error { |
6755
|
|
|
if m == nil { |
6756
|
|
|
return nil |
6757
|
|
|
} |
6758
|
|
|
|
6759
|
|
|
var errors []error |
6760
|
|
|
|
6761
|
|
|
// no validation rules for SnapToken |
6762
|
|
|
|
6763
|
|
|
if len(errors) > 0 { |
6764
|
|
|
return RelationshipWriteResponseMultiError(errors) |
6765
|
|
|
} |
6766
|
|
|
|
6767
|
|
|
return nil |
6768
|
|
|
} |
6769
|
|
|
|
6770
|
|
|
// RelationshipWriteResponseMultiError is an error wrapping multiple validation |
6771
|
|
|
// errors returned by RelationshipWriteResponse.ValidateAll() if the |
6772
|
|
|
// designated constraints aren't met. |
6773
|
|
|
type RelationshipWriteResponseMultiError []error |
6774
|
|
|
|
6775
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6776
|
|
|
func (m RelationshipWriteResponseMultiError) Error() string { |
6777
|
|
|
var msgs []string |
6778
|
|
|
for _, err := range m { |
6779
|
|
|
msgs = append(msgs, err.Error()) |
6780
|
|
|
} |
6781
|
|
|
return strings.Join(msgs, "; ") |
6782
|
|
|
} |
6783
|
|
|
|
6784
|
|
|
// AllErrors returns a list of validation violation errors. |
6785
|
|
|
func (m RelationshipWriteResponseMultiError) AllErrors() []error { return m } |
6786
|
|
|
|
6787
|
|
|
// RelationshipWriteResponseValidationError is the validation error returned by |
6788
|
|
|
// RelationshipWriteResponse.Validate if the designated constraints aren't met. |
6789
|
|
|
type RelationshipWriteResponseValidationError struct { |
6790
|
|
|
field string |
6791
|
|
|
reason string |
6792
|
|
|
cause error |
6793
|
|
|
key bool |
6794
|
|
|
} |
6795
|
|
|
|
6796
|
|
|
// Field function returns field value. |
6797
|
|
|
func (e RelationshipWriteResponseValidationError) Field() string { return e.field } |
6798
|
|
|
|
6799
|
|
|
// Reason function returns reason value. |
6800
|
|
|
func (e RelationshipWriteResponseValidationError) Reason() string { return e.reason } |
6801
|
|
|
|
6802
|
|
|
// Cause function returns cause value. |
6803
|
|
|
func (e RelationshipWriteResponseValidationError) Cause() error { return e.cause } |
6804
|
|
|
|
6805
|
|
|
// Key function returns key value. |
6806
|
|
|
func (e RelationshipWriteResponseValidationError) Key() bool { return e.key } |
6807
|
|
|
|
6808
|
|
|
// ErrorName returns error name. |
6809
|
|
|
func (e RelationshipWriteResponseValidationError) ErrorName() string { |
6810
|
|
|
return "RelationshipWriteResponseValidationError" |
6811
|
|
|
} |
6812
|
|
|
|
6813
|
|
|
// Error satisfies the builtin error interface |
6814
|
|
|
func (e RelationshipWriteResponseValidationError) Error() string { |
6815
|
|
|
cause := "" |
6816
|
|
|
if e.cause != nil { |
6817
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6818
|
|
|
} |
6819
|
|
|
|
6820
|
|
|
key := "" |
6821
|
|
|
if e.key { |
6822
|
|
|
key = "key for " |
6823
|
|
|
} |
6824
|
|
|
|
6825
|
|
|
return fmt.Sprintf( |
6826
|
|
|
"invalid %sRelationshipWriteResponse.%s: %s%s", |
6827
|
|
|
key, |
6828
|
|
|
e.field, |
6829
|
|
|
e.reason, |
6830
|
|
|
cause) |
6831
|
|
|
} |
6832
|
|
|
|
6833
|
|
|
var _ error = RelationshipWriteResponseValidationError{} |
6834
|
|
|
|
6835
|
|
|
var _ interface { |
6836
|
|
|
Field() string |
6837
|
|
|
Reason() string |
6838
|
|
|
Key() bool |
6839
|
|
|
Cause() error |
6840
|
|
|
ErrorName() string |
6841
|
|
|
} = RelationshipWriteResponseValidationError{} |
6842
|
|
|
|
6843
|
|
|
// Validate checks the field values on RelationshipReadRequest with the rules |
6844
|
|
|
// defined in the proto definition for this message. If any rules are |
6845
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6846
|
|
|
func (m *RelationshipReadRequest) Validate() error { |
6847
|
|
|
return m.validate(false) |
6848
|
|
|
} |
6849
|
|
|
|
6850
|
|
|
// ValidateAll checks the field values on RelationshipReadRequest with the |
6851
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6852
|
|
|
// violated, the result is a list of violation errors wrapped in |
6853
|
|
|
// RelationshipReadRequestMultiError, or nil if none found. |
6854
|
|
|
func (m *RelationshipReadRequest) ValidateAll() error { |
6855
|
|
|
return m.validate(true) |
6856
|
|
|
} |
6857
|
|
|
|
6858
|
|
|
func (m *RelationshipReadRequest) validate(all bool) error { |
6859
|
|
|
if m == nil { |
6860
|
|
|
return nil |
6861
|
|
|
} |
6862
|
|
|
|
6863
|
|
|
var errors []error |
6864
|
|
|
|
6865
|
|
|
if len(m.GetTenantId()) > 128 { |
6866
|
|
|
err := RelationshipReadRequestValidationError{ |
6867
|
|
|
field: "TenantId", |
6868
|
|
|
reason: "value length must be at most 128 bytes", |
6869
|
|
|
} |
6870
|
|
|
if !all { |
6871
|
|
|
return err |
6872
|
|
|
} |
6873
|
|
|
errors = append(errors, err) |
6874
|
|
|
} |
6875
|
|
|
|
6876
|
|
|
if !_RelationshipReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
6877
|
|
|
err := RelationshipReadRequestValidationError{ |
6878
|
|
|
field: "TenantId", |
6879
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
6880
|
|
|
} |
6881
|
|
|
if !all { |
6882
|
|
|
return err |
6883
|
|
|
} |
6884
|
|
|
errors = append(errors, err) |
6885
|
|
|
} |
6886
|
|
|
|
6887
|
|
|
if m.GetMetadata() == nil { |
6888
|
|
|
err := RelationshipReadRequestValidationError{ |
6889
|
|
|
field: "Metadata", |
6890
|
|
|
reason: "value is required", |
6891
|
|
|
} |
6892
|
|
|
if !all { |
6893
|
|
|
return err |
6894
|
|
|
} |
6895
|
|
|
errors = append(errors, err) |
6896
|
|
|
} |
6897
|
|
|
|
6898
|
|
|
if all { |
6899
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
6900
|
|
|
case interface{ ValidateAll() error }: |
6901
|
|
|
if err := v.ValidateAll(); err != nil { |
6902
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6903
|
|
|
field: "Metadata", |
6904
|
|
|
reason: "embedded message failed validation", |
6905
|
|
|
cause: err, |
6906
|
|
|
}) |
6907
|
|
|
} |
6908
|
|
|
case interface{ Validate() error }: |
6909
|
|
|
if err := v.Validate(); err != nil { |
6910
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6911
|
|
|
field: "Metadata", |
6912
|
|
|
reason: "embedded message failed validation", |
6913
|
|
|
cause: err, |
6914
|
|
|
}) |
6915
|
|
|
} |
6916
|
|
|
} |
6917
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6918
|
|
|
if err := v.Validate(); err != nil { |
6919
|
|
|
return RelationshipReadRequestValidationError{ |
6920
|
|
|
field: "Metadata", |
6921
|
|
|
reason: "embedded message failed validation", |
6922
|
|
|
cause: err, |
6923
|
|
|
} |
6924
|
|
|
} |
6925
|
|
|
} |
6926
|
|
|
|
6927
|
|
|
if m.GetFilter() == nil { |
6928
|
|
|
err := RelationshipReadRequestValidationError{ |
6929
|
|
|
field: "Filter", |
6930
|
|
|
reason: "value is required", |
6931
|
|
|
} |
6932
|
|
|
if !all { |
6933
|
|
|
return err |
6934
|
|
|
} |
6935
|
|
|
errors = append(errors, err) |
6936
|
|
|
} |
6937
|
|
|
|
6938
|
|
|
if all { |
6939
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
6940
|
|
|
case interface{ ValidateAll() error }: |
6941
|
|
|
if err := v.ValidateAll(); err != nil { |
6942
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6943
|
|
|
field: "Filter", |
6944
|
|
|
reason: "embedded message failed validation", |
6945
|
|
|
cause: err, |
6946
|
|
|
}) |
6947
|
|
|
} |
6948
|
|
|
case interface{ Validate() error }: |
6949
|
|
|
if err := v.Validate(); err != nil { |
6950
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6951
|
|
|
field: "Filter", |
6952
|
|
|
reason: "embedded message failed validation", |
6953
|
|
|
cause: err, |
6954
|
|
|
}) |
6955
|
|
|
} |
6956
|
|
|
} |
6957
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
6958
|
|
|
if err := v.Validate(); err != nil { |
6959
|
|
|
return RelationshipReadRequestValidationError{ |
6960
|
|
|
field: "Filter", |
6961
|
|
|
reason: "embedded message failed validation", |
6962
|
|
|
cause: err, |
6963
|
|
|
} |
6964
|
|
|
} |
6965
|
|
|
} |
6966
|
|
|
|
6967
|
|
|
if m.GetPageSize() != 0 { |
6968
|
|
|
|
6969
|
|
|
if m.GetPageSize() < 1 { |
6970
|
|
|
err := RelationshipReadRequestValidationError{ |
6971
|
|
|
field: "PageSize", |
6972
|
|
|
reason: "value must be greater than or equal to 1", |
6973
|
|
|
} |
6974
|
|
|
if !all { |
6975
|
|
|
return err |
6976
|
|
|
} |
6977
|
|
|
errors = append(errors, err) |
6978
|
|
|
} |
6979
|
|
|
|
6980
|
|
|
} |
6981
|
|
|
|
6982
|
|
|
if m.GetContinuousToken() != "" { |
6983
|
|
|
|
6984
|
|
|
} |
6985
|
|
|
|
6986
|
|
|
if len(errors) > 0 { |
6987
|
|
|
return RelationshipReadRequestMultiError(errors) |
6988
|
|
|
} |
6989
|
|
|
|
6990
|
|
|
return nil |
6991
|
|
|
} |
6992
|
|
|
|
6993
|
|
|
// RelationshipReadRequestMultiError is an error wrapping multiple validation |
6994
|
|
|
// errors returned by RelationshipReadRequest.ValidateAll() if the designated |
6995
|
|
|
// constraints aren't met. |
6996
|
|
|
type RelationshipReadRequestMultiError []error |
6997
|
|
|
|
6998
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6999
|
|
|
func (m RelationshipReadRequestMultiError) Error() string { |
7000
|
|
|
var msgs []string |
7001
|
|
|
for _, err := range m { |
7002
|
|
|
msgs = append(msgs, err.Error()) |
7003
|
|
|
} |
7004
|
|
|
return strings.Join(msgs, "; ") |
7005
|
|
|
} |
7006
|
|
|
|
7007
|
|
|
// AllErrors returns a list of validation violation errors. |
7008
|
|
|
func (m RelationshipReadRequestMultiError) AllErrors() []error { return m } |
7009
|
|
|
|
7010
|
|
|
// RelationshipReadRequestValidationError is the validation error returned by |
7011
|
|
|
// RelationshipReadRequest.Validate if the designated constraints aren't met. |
7012
|
|
|
type RelationshipReadRequestValidationError struct { |
7013
|
|
|
field string |
7014
|
|
|
reason string |
7015
|
|
|
cause error |
7016
|
|
|
key bool |
7017
|
|
|
} |
7018
|
|
|
|
7019
|
|
|
// Field function returns field value. |
7020
|
|
|
func (e RelationshipReadRequestValidationError) Field() string { return e.field } |
7021
|
|
|
|
7022
|
|
|
// Reason function returns reason value. |
7023
|
|
|
func (e RelationshipReadRequestValidationError) Reason() string { return e.reason } |
7024
|
|
|
|
7025
|
|
|
// Cause function returns cause value. |
7026
|
|
|
func (e RelationshipReadRequestValidationError) Cause() error { return e.cause } |
7027
|
|
|
|
7028
|
|
|
// Key function returns key value. |
7029
|
|
|
func (e RelationshipReadRequestValidationError) Key() bool { return e.key } |
7030
|
|
|
|
7031
|
|
|
// ErrorName returns error name. |
7032
|
|
|
func (e RelationshipReadRequestValidationError) ErrorName() string { |
7033
|
|
|
return "RelationshipReadRequestValidationError" |
7034
|
|
|
} |
7035
|
|
|
|
7036
|
|
|
// Error satisfies the builtin error interface |
7037
|
|
|
func (e RelationshipReadRequestValidationError) Error() string { |
7038
|
|
|
cause := "" |
7039
|
|
|
if e.cause != nil { |
7040
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7041
|
|
|
} |
7042
|
|
|
|
7043
|
|
|
key := "" |
7044
|
|
|
if e.key { |
7045
|
|
|
key = "key for " |
7046
|
|
|
} |
7047
|
|
|
|
7048
|
|
|
return fmt.Sprintf( |
7049
|
|
|
"invalid %sRelationshipReadRequest.%s: %s%s", |
7050
|
|
|
key, |
7051
|
|
|
e.field, |
7052
|
|
|
e.reason, |
7053
|
|
|
cause) |
7054
|
|
|
} |
7055
|
|
|
|
7056
|
|
|
var _ error = RelationshipReadRequestValidationError{} |
7057
|
|
|
|
7058
|
|
|
var _ interface { |
7059
|
|
|
Field() string |
7060
|
|
|
Reason() string |
7061
|
|
|
Key() bool |
7062
|
|
|
Cause() error |
7063
|
|
|
ErrorName() string |
7064
|
|
|
} = RelationshipReadRequestValidationError{} |
7065
|
|
|
|
7066
|
|
|
var _RelationshipReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7067
|
|
|
|
7068
|
|
|
// Validate checks the field values on RelationshipReadRequestMetadata with the |
7069
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7070
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7071
|
|
|
func (m *RelationshipReadRequestMetadata) Validate() error { |
7072
|
|
|
return m.validate(false) |
7073
|
|
|
} |
7074
|
|
|
|
7075
|
|
|
// ValidateAll checks the field values on RelationshipReadRequestMetadata with |
7076
|
|
|
// the rules defined in the proto definition for this message. If any rules |
7077
|
|
|
// are violated, the result is a list of violation errors wrapped in |
7078
|
|
|
// RelationshipReadRequestMetadataMultiError, or nil if none found. |
7079
|
|
|
func (m *RelationshipReadRequestMetadata) ValidateAll() error { |
7080
|
|
|
return m.validate(true) |
7081
|
|
|
} |
7082
|
|
|
|
7083
|
|
|
func (m *RelationshipReadRequestMetadata) validate(all bool) error { |
7084
|
|
|
if m == nil { |
7085
|
|
|
return nil |
7086
|
|
|
} |
7087
|
|
|
|
7088
|
|
|
var errors []error |
7089
|
|
|
|
7090
|
|
|
// no validation rules for SnapToken |
7091
|
|
|
|
7092
|
|
|
if len(errors) > 0 { |
7093
|
|
|
return RelationshipReadRequestMetadataMultiError(errors) |
7094
|
|
|
} |
7095
|
|
|
|
7096
|
|
|
return nil |
7097
|
|
|
} |
7098
|
|
|
|
7099
|
|
|
// RelationshipReadRequestMetadataMultiError is an error wrapping multiple |
7100
|
|
|
// validation errors returned by RelationshipReadRequestMetadata.ValidateAll() |
7101
|
|
|
// if the designated constraints aren't met. |
7102
|
|
|
type RelationshipReadRequestMetadataMultiError []error |
7103
|
|
|
|
7104
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7105
|
|
|
func (m RelationshipReadRequestMetadataMultiError) Error() string { |
7106
|
|
|
var msgs []string |
7107
|
|
|
for _, err := range m { |
7108
|
|
|
msgs = append(msgs, err.Error()) |
7109
|
|
|
} |
7110
|
|
|
return strings.Join(msgs, "; ") |
7111
|
|
|
} |
7112
|
|
|
|
7113
|
|
|
// AllErrors returns a list of validation violation errors. |
7114
|
|
|
func (m RelationshipReadRequestMetadataMultiError) AllErrors() []error { return m } |
7115
|
|
|
|
7116
|
|
|
// RelationshipReadRequestMetadataValidationError is the validation error |
7117
|
|
|
// returned by RelationshipReadRequestMetadata.Validate if the designated |
7118
|
|
|
// constraints aren't met. |
7119
|
|
|
type RelationshipReadRequestMetadataValidationError struct { |
7120
|
|
|
field string |
7121
|
|
|
reason string |
7122
|
|
|
cause error |
7123
|
|
|
key bool |
7124
|
|
|
} |
7125
|
|
|
|
7126
|
|
|
// Field function returns field value. |
7127
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Field() string { return e.field } |
7128
|
|
|
|
7129
|
|
|
// Reason function returns reason value. |
7130
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Reason() string { return e.reason } |
7131
|
|
|
|
7132
|
|
|
// Cause function returns cause value. |
7133
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Cause() error { return e.cause } |
7134
|
|
|
|
7135
|
|
|
// Key function returns key value. |
7136
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Key() bool { return e.key } |
7137
|
|
|
|
7138
|
|
|
// ErrorName returns error name. |
7139
|
|
|
func (e RelationshipReadRequestMetadataValidationError) ErrorName() string { |
7140
|
|
|
return "RelationshipReadRequestMetadataValidationError" |
7141
|
|
|
} |
7142
|
|
|
|
7143
|
|
|
// Error satisfies the builtin error interface |
7144
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Error() string { |
7145
|
|
|
cause := "" |
7146
|
|
|
if e.cause != nil { |
7147
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7148
|
|
|
} |
7149
|
|
|
|
7150
|
|
|
key := "" |
7151
|
|
|
if e.key { |
7152
|
|
|
key = "key for " |
7153
|
|
|
} |
7154
|
|
|
|
7155
|
|
|
return fmt.Sprintf( |
7156
|
|
|
"invalid %sRelationshipReadRequestMetadata.%s: %s%s", |
7157
|
|
|
key, |
7158
|
|
|
e.field, |
7159
|
|
|
e.reason, |
7160
|
|
|
cause) |
7161
|
|
|
} |
7162
|
|
|
|
7163
|
|
|
var _ error = RelationshipReadRequestMetadataValidationError{} |
7164
|
|
|
|
7165
|
|
|
var _ interface { |
7166
|
|
|
Field() string |
7167
|
|
|
Reason() string |
7168
|
|
|
Key() bool |
7169
|
|
|
Cause() error |
7170
|
|
|
ErrorName() string |
7171
|
|
|
} = RelationshipReadRequestMetadataValidationError{} |
7172
|
|
|
|
7173
|
|
|
// Validate checks the field values on RelationshipReadResponse with the rules |
7174
|
|
|
// defined in the proto definition for this message. If any rules are |
7175
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7176
|
|
|
func (m *RelationshipReadResponse) Validate() error { |
7177
|
|
|
return m.validate(false) |
7178
|
|
|
} |
7179
|
|
|
|
7180
|
|
|
// ValidateAll checks the field values on RelationshipReadResponse with the |
7181
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7182
|
|
|
// violated, the result is a list of violation errors wrapped in |
7183
|
|
|
// RelationshipReadResponseMultiError, or nil if none found. |
7184
|
|
|
func (m *RelationshipReadResponse) ValidateAll() error { |
7185
|
|
|
return m.validate(true) |
7186
|
|
|
} |
7187
|
|
|
|
7188
|
|
|
func (m *RelationshipReadResponse) validate(all bool) error { |
7189
|
|
|
if m == nil { |
7190
|
|
|
return nil |
7191
|
|
|
} |
7192
|
|
|
|
7193
|
|
|
var errors []error |
7194
|
|
|
|
7195
|
|
|
for idx, item := range m.GetTuples() { |
7196
|
|
|
_, _ = idx, item |
7197
|
|
|
|
7198
|
|
|
if all { |
7199
|
|
|
switch v := interface{}(item).(type) { |
7200
|
|
|
case interface{ ValidateAll() error }: |
7201
|
|
|
if err := v.ValidateAll(); err != nil { |
7202
|
|
|
errors = append(errors, RelationshipReadResponseValidationError{ |
7203
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
7204
|
|
|
reason: "embedded message failed validation", |
7205
|
|
|
cause: err, |
7206
|
|
|
}) |
7207
|
|
|
} |
7208
|
|
|
case interface{ Validate() error }: |
7209
|
|
|
if err := v.Validate(); err != nil { |
7210
|
|
|
errors = append(errors, RelationshipReadResponseValidationError{ |
7211
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
7212
|
|
|
reason: "embedded message failed validation", |
7213
|
|
|
cause: err, |
7214
|
|
|
}) |
7215
|
|
|
} |
7216
|
|
|
} |
7217
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
7218
|
|
|
if err := v.Validate(); err != nil { |
7219
|
|
|
return RelationshipReadResponseValidationError{ |
7220
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
7221
|
|
|
reason: "embedded message failed validation", |
7222
|
|
|
cause: err, |
7223
|
|
|
} |
7224
|
|
|
} |
7225
|
|
|
} |
7226
|
|
|
|
7227
|
|
|
} |
7228
|
|
|
|
7229
|
|
|
// no validation rules for ContinuousToken |
7230
|
|
|
|
7231
|
|
|
if len(errors) > 0 { |
7232
|
|
|
return RelationshipReadResponseMultiError(errors) |
7233
|
|
|
} |
7234
|
|
|
|
7235
|
|
|
return nil |
7236
|
|
|
} |
7237
|
|
|
|
7238
|
|
|
// RelationshipReadResponseMultiError is an error wrapping multiple validation |
7239
|
|
|
// errors returned by RelationshipReadResponse.ValidateAll() if the designated |
7240
|
|
|
// constraints aren't met. |
7241
|
|
|
type RelationshipReadResponseMultiError []error |
7242
|
|
|
|
7243
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7244
|
|
|
func (m RelationshipReadResponseMultiError) Error() string { |
7245
|
|
|
var msgs []string |
7246
|
|
|
for _, err := range m { |
7247
|
|
|
msgs = append(msgs, err.Error()) |
7248
|
|
|
} |
7249
|
|
|
return strings.Join(msgs, "; ") |
7250
|
|
|
} |
7251
|
|
|
|
7252
|
|
|
// AllErrors returns a list of validation violation errors. |
7253
|
|
|
func (m RelationshipReadResponseMultiError) AllErrors() []error { return m } |
7254
|
|
|
|
7255
|
|
|
// RelationshipReadResponseValidationError is the validation error returned by |
7256
|
|
|
// RelationshipReadResponse.Validate if the designated constraints aren't met. |
7257
|
|
|
type RelationshipReadResponseValidationError struct { |
7258
|
|
|
field string |
7259
|
|
|
reason string |
7260
|
|
|
cause error |
7261
|
|
|
key bool |
7262
|
|
|
} |
7263
|
|
|
|
7264
|
|
|
// Field function returns field value. |
7265
|
|
|
func (e RelationshipReadResponseValidationError) Field() string { return e.field } |
7266
|
|
|
|
7267
|
|
|
// Reason function returns reason value. |
7268
|
|
|
func (e RelationshipReadResponseValidationError) Reason() string { return e.reason } |
7269
|
|
|
|
7270
|
|
|
// Cause function returns cause value. |
7271
|
|
|
func (e RelationshipReadResponseValidationError) Cause() error { return e.cause } |
7272
|
|
|
|
7273
|
|
|
// Key function returns key value. |
7274
|
|
|
func (e RelationshipReadResponseValidationError) Key() bool { return e.key } |
7275
|
|
|
|
7276
|
|
|
// ErrorName returns error name. |
7277
|
|
|
func (e RelationshipReadResponseValidationError) ErrorName() string { |
7278
|
|
|
return "RelationshipReadResponseValidationError" |
7279
|
|
|
} |
7280
|
|
|
|
7281
|
|
|
// Error satisfies the builtin error interface |
7282
|
|
|
func (e RelationshipReadResponseValidationError) Error() string { |
7283
|
|
|
cause := "" |
7284
|
|
|
if e.cause != nil { |
7285
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7286
|
|
|
} |
7287
|
|
|
|
7288
|
|
|
key := "" |
7289
|
|
|
if e.key { |
7290
|
|
|
key = "key for " |
7291
|
|
|
} |
7292
|
|
|
|
7293
|
|
|
return fmt.Sprintf( |
7294
|
|
|
"invalid %sRelationshipReadResponse.%s: %s%s", |
7295
|
|
|
key, |
7296
|
|
|
e.field, |
7297
|
|
|
e.reason, |
7298
|
|
|
cause) |
7299
|
|
|
} |
7300
|
|
|
|
7301
|
|
|
var _ error = RelationshipReadResponseValidationError{} |
7302
|
|
|
|
7303
|
|
|
var _ interface { |
7304
|
|
|
Field() string |
7305
|
|
|
Reason() string |
7306
|
|
|
Key() bool |
7307
|
|
|
Cause() error |
7308
|
|
|
ErrorName() string |
7309
|
|
|
} = RelationshipReadResponseValidationError{} |
7310
|
|
|
|
7311
|
|
|
// Validate checks the field values on AttributeReadRequest with the rules |
7312
|
|
|
// defined in the proto definition for this message. If any rules are |
7313
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7314
|
|
|
func (m *AttributeReadRequest) Validate() error { |
7315
|
|
|
return m.validate(false) |
7316
|
|
|
} |
7317
|
|
|
|
7318
|
|
|
// ValidateAll checks the field values on AttributeReadRequest with the rules |
7319
|
|
|
// defined in the proto definition for this message. If any rules are |
7320
|
|
|
// violated, the result is a list of violation errors wrapped in |
7321
|
|
|
// AttributeReadRequestMultiError, or nil if none found. |
7322
|
|
|
func (m *AttributeReadRequest) ValidateAll() error { |
7323
|
|
|
return m.validate(true) |
7324
|
|
|
} |
7325
|
|
|
|
7326
|
|
|
func (m *AttributeReadRequest) validate(all bool) error { |
7327
|
|
|
if m == nil { |
7328
|
|
|
return nil |
7329
|
|
|
} |
7330
|
|
|
|
7331
|
|
|
var errors []error |
7332
|
|
|
|
7333
|
|
|
if len(m.GetTenantId()) > 128 { |
7334
|
|
|
err := AttributeReadRequestValidationError{ |
7335
|
|
|
field: "TenantId", |
7336
|
|
|
reason: "value length must be at most 128 bytes", |
7337
|
|
|
} |
7338
|
|
|
if !all { |
7339
|
|
|
return err |
7340
|
|
|
} |
7341
|
|
|
errors = append(errors, err) |
7342
|
|
|
} |
7343
|
|
|
|
7344
|
|
|
if !_AttributeReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7345
|
|
|
err := AttributeReadRequestValidationError{ |
7346
|
|
|
field: "TenantId", |
7347
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7348
|
|
|
} |
7349
|
|
|
if !all { |
7350
|
|
|
return err |
7351
|
|
|
} |
7352
|
|
|
errors = append(errors, err) |
7353
|
|
|
} |
7354
|
|
|
|
7355
|
|
|
if m.GetMetadata() == nil { |
7356
|
|
|
err := AttributeReadRequestValidationError{ |
7357
|
|
|
field: "Metadata", |
7358
|
|
|
reason: "value is required", |
7359
|
|
|
} |
7360
|
|
|
if !all { |
7361
|
|
|
return err |
7362
|
|
|
} |
7363
|
|
|
errors = append(errors, err) |
7364
|
|
|
} |
7365
|
|
|
|
7366
|
|
|
if all { |
7367
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
7368
|
|
|
case interface{ ValidateAll() error }: |
7369
|
|
|
if err := v.ValidateAll(); err != nil { |
7370
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7371
|
|
|
field: "Metadata", |
7372
|
|
|
reason: "embedded message failed validation", |
7373
|
|
|
cause: err, |
7374
|
|
|
}) |
7375
|
|
|
} |
7376
|
|
|
case interface{ Validate() error }: |
7377
|
|
|
if err := v.Validate(); err != nil { |
7378
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7379
|
|
|
field: "Metadata", |
7380
|
|
|
reason: "embedded message failed validation", |
7381
|
|
|
cause: err, |
7382
|
|
|
}) |
7383
|
|
|
} |
7384
|
|
|
} |
7385
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
7386
|
|
|
if err := v.Validate(); err != nil { |
7387
|
|
|
return AttributeReadRequestValidationError{ |
7388
|
|
|
field: "Metadata", |
7389
|
|
|
reason: "embedded message failed validation", |
7390
|
|
|
cause: err, |
7391
|
|
|
} |
7392
|
|
|
} |
7393
|
|
|
} |
7394
|
|
|
|
7395
|
|
|
if m.GetFilter() == nil { |
7396
|
|
|
err := AttributeReadRequestValidationError{ |
7397
|
|
|
field: "Filter", |
7398
|
|
|
reason: "value is required", |
7399
|
|
|
} |
7400
|
|
|
if !all { |
7401
|
|
|
return err |
7402
|
|
|
} |
7403
|
|
|
errors = append(errors, err) |
7404
|
|
|
} |
7405
|
|
|
|
7406
|
|
|
if all { |
7407
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
7408
|
|
|
case interface{ ValidateAll() error }: |
7409
|
|
|
if err := v.ValidateAll(); err != nil { |
7410
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7411
|
|
|
field: "Filter", |
7412
|
|
|
reason: "embedded message failed validation", |
7413
|
|
|
cause: err, |
7414
|
|
|
}) |
7415
|
|
|
} |
7416
|
|
|
case interface{ Validate() error }: |
7417
|
|
|
if err := v.Validate(); err != nil { |
7418
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
7419
|
|
|
field: "Filter", |
7420
|
|
|
reason: "embedded message failed validation", |
7421
|
|
|
cause: err, |
7422
|
|
|
}) |
7423
|
|
|
} |
7424
|
|
|
} |
7425
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
7426
|
|
|
if err := v.Validate(); err != nil { |
7427
|
|
|
return AttributeReadRequestValidationError{ |
7428
|
|
|
field: "Filter", |
7429
|
|
|
reason: "embedded message failed validation", |
7430
|
|
|
cause: err, |
7431
|
|
|
} |
7432
|
|
|
} |
7433
|
|
|
} |
7434
|
|
|
|
7435
|
|
|
if m.GetPageSize() != 0 { |
7436
|
|
|
|
7437
|
|
|
if m.GetPageSize() < 1 { |
7438
|
|
|
err := AttributeReadRequestValidationError{ |
7439
|
|
|
field: "PageSize", |
7440
|
|
|
reason: "value must be greater than or equal to 1", |
7441
|
|
|
} |
7442
|
|
|
if !all { |
7443
|
|
|
return err |
7444
|
|
|
} |
7445
|
|
|
errors = append(errors, err) |
7446
|
|
|
} |
7447
|
|
|
|
7448
|
|
|
} |
7449
|
|
|
|
7450
|
|
|
if m.GetContinuousToken() != "" { |
7451
|
|
|
|
7452
|
|
|
} |
7453
|
|
|
|
7454
|
|
|
if len(errors) > 0 { |
7455
|
|
|
return AttributeReadRequestMultiError(errors) |
7456
|
|
|
} |
7457
|
|
|
|
7458
|
|
|
return nil |
7459
|
|
|
} |
7460
|
|
|
|
7461
|
|
|
// AttributeReadRequestMultiError is an error wrapping multiple validation |
7462
|
|
|
// errors returned by AttributeReadRequest.ValidateAll() if the designated |
7463
|
|
|
// constraints aren't met. |
7464
|
|
|
type AttributeReadRequestMultiError []error |
7465
|
|
|
|
7466
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7467
|
|
|
func (m AttributeReadRequestMultiError) Error() string { |
7468
|
|
|
var msgs []string |
7469
|
|
|
for _, err := range m { |
7470
|
|
|
msgs = append(msgs, err.Error()) |
7471
|
|
|
} |
7472
|
|
|
return strings.Join(msgs, "; ") |
7473
|
|
|
} |
7474
|
|
|
|
7475
|
|
|
// AllErrors returns a list of validation violation errors. |
7476
|
|
|
func (m AttributeReadRequestMultiError) AllErrors() []error { return m } |
7477
|
|
|
|
7478
|
|
|
// AttributeReadRequestValidationError is the validation error returned by |
7479
|
|
|
// AttributeReadRequest.Validate if the designated constraints aren't met. |
7480
|
|
|
type AttributeReadRequestValidationError struct { |
7481
|
|
|
field string |
7482
|
|
|
reason string |
7483
|
|
|
cause error |
7484
|
|
|
key bool |
7485
|
|
|
} |
7486
|
|
|
|
7487
|
|
|
// Field function returns field value. |
7488
|
|
|
func (e AttributeReadRequestValidationError) Field() string { return e.field } |
7489
|
|
|
|
7490
|
|
|
// Reason function returns reason value. |
7491
|
|
|
func (e AttributeReadRequestValidationError) Reason() string { return e.reason } |
7492
|
|
|
|
7493
|
|
|
// Cause function returns cause value. |
7494
|
|
|
func (e AttributeReadRequestValidationError) Cause() error { return e.cause } |
7495
|
|
|
|
7496
|
|
|
// Key function returns key value. |
7497
|
|
|
func (e AttributeReadRequestValidationError) Key() bool { return e.key } |
7498
|
|
|
|
7499
|
|
|
// ErrorName returns error name. |
7500
|
|
|
func (e AttributeReadRequestValidationError) ErrorName() string { |
7501
|
|
|
return "AttributeReadRequestValidationError" |
7502
|
|
|
} |
7503
|
|
|
|
7504
|
|
|
// Error satisfies the builtin error interface |
7505
|
|
|
func (e AttributeReadRequestValidationError) Error() string { |
7506
|
|
|
cause := "" |
7507
|
|
|
if e.cause != nil { |
7508
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7509
|
|
|
} |
7510
|
|
|
|
7511
|
|
|
key := "" |
7512
|
|
|
if e.key { |
7513
|
|
|
key = "key for " |
7514
|
|
|
} |
7515
|
|
|
|
7516
|
|
|
return fmt.Sprintf( |
7517
|
|
|
"invalid %sAttributeReadRequest.%s: %s%s", |
7518
|
|
|
key, |
7519
|
|
|
e.field, |
7520
|
|
|
e.reason, |
7521
|
|
|
cause) |
7522
|
|
|
} |
7523
|
|
|
|
7524
|
|
|
var _ error = AttributeReadRequestValidationError{} |
7525
|
|
|
|
7526
|
|
|
var _ interface { |
7527
|
|
|
Field() string |
7528
|
|
|
Reason() string |
7529
|
|
|
Key() bool |
7530
|
|
|
Cause() error |
7531
|
|
|
ErrorName() string |
7532
|
|
|
} = AttributeReadRequestValidationError{} |
7533
|
|
|
|
7534
|
|
|
var _AttributeReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7535
|
|
|
|
7536
|
|
|
// Validate checks the field values on AttributeReadRequestMetadata with the |
7537
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7538
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7539
|
|
|
func (m *AttributeReadRequestMetadata) Validate() error { |
7540
|
|
|
return m.validate(false) |
7541
|
|
|
} |
7542
|
|
|
|
7543
|
|
|
// ValidateAll checks the field values on AttributeReadRequestMetadata with the |
7544
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7545
|
|
|
// violated, the result is a list of violation errors wrapped in |
7546
|
|
|
// AttributeReadRequestMetadataMultiError, or nil if none found. |
7547
|
|
|
func (m *AttributeReadRequestMetadata) ValidateAll() error { |
7548
|
|
|
return m.validate(true) |
7549
|
|
|
} |
7550
|
|
|
|
7551
|
|
|
func (m *AttributeReadRequestMetadata) validate(all bool) error { |
7552
|
|
|
if m == nil { |
7553
|
|
|
return nil |
7554
|
|
|
} |
7555
|
|
|
|
7556
|
|
|
var errors []error |
7557
|
|
|
|
7558
|
|
|
// no validation rules for SnapToken |
7559
|
|
|
|
7560
|
|
|
if len(errors) > 0 { |
7561
|
|
|
return AttributeReadRequestMetadataMultiError(errors) |
7562
|
|
|
} |
7563
|
|
|
|
7564
|
|
|
return nil |
7565
|
|
|
} |
7566
|
|
|
|
7567
|
|
|
// AttributeReadRequestMetadataMultiError is an error wrapping multiple |
7568
|
|
|
// validation errors returned by AttributeReadRequestMetadata.ValidateAll() if |
7569
|
|
|
// the designated constraints aren't met. |
7570
|
|
|
type AttributeReadRequestMetadataMultiError []error |
7571
|
|
|
|
7572
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7573
|
|
|
func (m AttributeReadRequestMetadataMultiError) Error() string { |
7574
|
|
|
var msgs []string |
7575
|
|
|
for _, err := range m { |
7576
|
|
|
msgs = append(msgs, err.Error()) |
7577
|
|
|
} |
7578
|
|
|
return strings.Join(msgs, "; ") |
7579
|
|
|
} |
7580
|
|
|
|
7581
|
|
|
// AllErrors returns a list of validation violation errors. |
7582
|
|
|
func (m AttributeReadRequestMetadataMultiError) AllErrors() []error { return m } |
7583
|
|
|
|
7584
|
|
|
// AttributeReadRequestMetadataValidationError is the validation error returned |
7585
|
|
|
// by AttributeReadRequestMetadata.Validate if the designated constraints |
7586
|
|
|
// aren't met. |
7587
|
|
|
type AttributeReadRequestMetadataValidationError struct { |
7588
|
|
|
field string |
7589
|
|
|
reason string |
7590
|
|
|
cause error |
7591
|
|
|
key bool |
7592
|
|
|
} |
7593
|
|
|
|
7594
|
|
|
// Field function returns field value. |
7595
|
|
|
func (e AttributeReadRequestMetadataValidationError) Field() string { return e.field } |
7596
|
|
|
|
7597
|
|
|
// Reason function returns reason value. |
7598
|
|
|
func (e AttributeReadRequestMetadataValidationError) Reason() string { return e.reason } |
7599
|
|
|
|
7600
|
|
|
// Cause function returns cause value. |
7601
|
|
|
func (e AttributeReadRequestMetadataValidationError) Cause() error { return e.cause } |
7602
|
|
|
|
7603
|
|
|
// Key function returns key value. |
7604
|
|
|
func (e AttributeReadRequestMetadataValidationError) Key() bool { return e.key } |
7605
|
|
|
|
7606
|
|
|
// ErrorName returns error name. |
7607
|
|
|
func (e AttributeReadRequestMetadataValidationError) ErrorName() string { |
7608
|
|
|
return "AttributeReadRequestMetadataValidationError" |
7609
|
|
|
} |
7610
|
|
|
|
7611
|
|
|
// Error satisfies the builtin error interface |
7612
|
|
|
func (e AttributeReadRequestMetadataValidationError) Error() string { |
7613
|
|
|
cause := "" |
7614
|
|
|
if e.cause != nil { |
7615
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7616
|
|
|
} |
7617
|
|
|
|
7618
|
|
|
key := "" |
7619
|
|
|
if e.key { |
7620
|
|
|
key = "key for " |
7621
|
|
|
} |
7622
|
|
|
|
7623
|
|
|
return fmt.Sprintf( |
7624
|
|
|
"invalid %sAttributeReadRequestMetadata.%s: %s%s", |
7625
|
|
|
key, |
7626
|
|
|
e.field, |
7627
|
|
|
e.reason, |
7628
|
|
|
cause) |
7629
|
|
|
} |
7630
|
|
|
|
7631
|
|
|
var _ error = AttributeReadRequestMetadataValidationError{} |
7632
|
|
|
|
7633
|
|
|
var _ interface { |
7634
|
|
|
Field() string |
7635
|
|
|
Reason() string |
7636
|
|
|
Key() bool |
7637
|
|
|
Cause() error |
7638
|
|
|
ErrorName() string |
7639
|
|
|
} = AttributeReadRequestMetadataValidationError{} |
7640
|
|
|
|
7641
|
|
|
// Validate checks the field values on AttributeReadResponse with the rules |
7642
|
|
|
// defined in the proto definition for this message. If any rules are |
7643
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7644
|
|
|
func (m *AttributeReadResponse) Validate() error { |
7645
|
|
|
return m.validate(false) |
7646
|
|
|
} |
7647
|
|
|
|
7648
|
|
|
// ValidateAll checks the field values on AttributeReadResponse with the rules |
7649
|
|
|
// defined in the proto definition for this message. If any rules are |
7650
|
|
|
// violated, the result is a list of violation errors wrapped in |
7651
|
|
|
// AttributeReadResponseMultiError, or nil if none found. |
7652
|
|
|
func (m *AttributeReadResponse) ValidateAll() error { |
7653
|
|
|
return m.validate(true) |
7654
|
|
|
} |
7655
|
|
|
|
7656
|
|
|
func (m *AttributeReadResponse) validate(all bool) error { |
7657
|
|
|
if m == nil { |
7658
|
|
|
return nil |
7659
|
|
|
} |
7660
|
|
|
|
7661
|
|
|
var errors []error |
7662
|
|
|
|
7663
|
|
|
for idx, item := range m.GetAttributes() { |
7664
|
|
|
_, _ = idx, item |
7665
|
|
|
|
7666
|
|
|
if all { |
7667
|
|
|
switch v := interface{}(item).(type) { |
7668
|
|
|
case interface{ ValidateAll() error }: |
7669
|
|
|
if err := v.ValidateAll(); err != nil { |
7670
|
|
|
errors = append(errors, AttributeReadResponseValidationError{ |
7671
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
7672
|
|
|
reason: "embedded message failed validation", |
7673
|
|
|
cause: err, |
7674
|
|
|
}) |
7675
|
|
|
} |
7676
|
|
|
case interface{ Validate() error }: |
7677
|
|
|
if err := v.Validate(); err != nil { |
7678
|
|
|
errors = append(errors, AttributeReadResponseValidationError{ |
7679
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
7680
|
|
|
reason: "embedded message failed validation", |
7681
|
|
|
cause: err, |
7682
|
|
|
}) |
7683
|
|
|
} |
7684
|
|
|
} |
7685
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
7686
|
|
|
if err := v.Validate(); err != nil { |
7687
|
|
|
return AttributeReadResponseValidationError{ |
7688
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
7689
|
|
|
reason: "embedded message failed validation", |
7690
|
|
|
cause: err, |
7691
|
|
|
} |
7692
|
|
|
} |
7693
|
|
|
} |
7694
|
|
|
|
7695
|
|
|
} |
7696
|
|
|
|
7697
|
|
|
// no validation rules for ContinuousToken |
7698
|
|
|
|
7699
|
|
|
if len(errors) > 0 { |
7700
|
|
|
return AttributeReadResponseMultiError(errors) |
7701
|
|
|
} |
7702
|
|
|
|
7703
|
|
|
return nil |
7704
|
|
|
} |
7705
|
|
|
|
7706
|
|
|
// AttributeReadResponseMultiError is an error wrapping multiple validation |
7707
|
|
|
// errors returned by AttributeReadResponse.ValidateAll() if the designated |
7708
|
|
|
// constraints aren't met. |
7709
|
|
|
type AttributeReadResponseMultiError []error |
7710
|
|
|
|
7711
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7712
|
|
|
func (m AttributeReadResponseMultiError) Error() string { |
7713
|
|
|
var msgs []string |
7714
|
|
|
for _, err := range m { |
7715
|
|
|
msgs = append(msgs, err.Error()) |
7716
|
|
|
} |
7717
|
|
|
return strings.Join(msgs, "; ") |
7718
|
|
|
} |
7719
|
|
|
|
7720
|
|
|
// AllErrors returns a list of validation violation errors. |
7721
|
|
|
func (m AttributeReadResponseMultiError) AllErrors() []error { return m } |
7722
|
|
|
|
7723
|
|
|
// AttributeReadResponseValidationError is the validation error returned by |
7724
|
|
|
// AttributeReadResponse.Validate if the designated constraints aren't met. |
7725
|
|
|
type AttributeReadResponseValidationError struct { |
7726
|
|
|
field string |
7727
|
|
|
reason string |
7728
|
|
|
cause error |
7729
|
|
|
key bool |
7730
|
|
|
} |
7731
|
|
|
|
7732
|
|
|
// Field function returns field value. |
7733
|
|
|
func (e AttributeReadResponseValidationError) Field() string { return e.field } |
7734
|
|
|
|
7735
|
|
|
// Reason function returns reason value. |
7736
|
|
|
func (e AttributeReadResponseValidationError) Reason() string { return e.reason } |
7737
|
|
|
|
7738
|
|
|
// Cause function returns cause value. |
7739
|
|
|
func (e AttributeReadResponseValidationError) Cause() error { return e.cause } |
7740
|
|
|
|
7741
|
|
|
// Key function returns key value. |
7742
|
|
|
func (e AttributeReadResponseValidationError) Key() bool { return e.key } |
7743
|
|
|
|
7744
|
|
|
// ErrorName returns error name. |
7745
|
|
|
func (e AttributeReadResponseValidationError) ErrorName() string { |
7746
|
|
|
return "AttributeReadResponseValidationError" |
7747
|
|
|
} |
7748
|
|
|
|
7749
|
|
|
// Error satisfies the builtin error interface |
7750
|
|
|
func (e AttributeReadResponseValidationError) Error() string { |
7751
|
|
|
cause := "" |
7752
|
|
|
if e.cause != nil { |
7753
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7754
|
|
|
} |
7755
|
|
|
|
7756
|
|
|
key := "" |
7757
|
|
|
if e.key { |
7758
|
|
|
key = "key for " |
7759
|
|
|
} |
7760
|
|
|
|
7761
|
|
|
return fmt.Sprintf( |
7762
|
|
|
"invalid %sAttributeReadResponse.%s: %s%s", |
7763
|
|
|
key, |
7764
|
|
|
e.field, |
7765
|
|
|
e.reason, |
7766
|
|
|
cause) |
7767
|
|
|
} |
7768
|
|
|
|
7769
|
|
|
var _ error = AttributeReadResponseValidationError{} |
7770
|
|
|
|
7771
|
|
|
var _ interface { |
7772
|
|
|
Field() string |
7773
|
|
|
Reason() string |
7774
|
|
|
Key() bool |
7775
|
|
|
Cause() error |
7776
|
|
|
ErrorName() string |
7777
|
|
|
} = AttributeReadResponseValidationError{} |
7778
|
|
|
|
7779
|
|
|
// Validate checks the field values on DataDeleteRequest with the rules defined |
7780
|
|
|
// in the proto definition for this message. If any rules are violated, the |
7781
|
|
|
// first error encountered is returned, or nil if there are no violations. |
7782
|
|
|
func (m *DataDeleteRequest) Validate() error { |
7783
|
|
|
return m.validate(false) |
7784
|
|
|
} |
7785
|
|
|
|
7786
|
|
|
// ValidateAll checks the field values on DataDeleteRequest with the rules |
7787
|
|
|
// defined in the proto definition for this message. If any rules are |
7788
|
|
|
// violated, the result is a list of violation errors wrapped in |
7789
|
|
|
// DataDeleteRequestMultiError, or nil if none found. |
7790
|
|
|
func (m *DataDeleteRequest) ValidateAll() error { |
7791
|
|
|
return m.validate(true) |
7792
|
|
|
} |
7793
|
|
|
|
7794
|
|
|
func (m *DataDeleteRequest) validate(all bool) error { |
7795
|
|
|
if m == nil { |
7796
|
|
|
return nil |
7797
|
|
|
} |
7798
|
|
|
|
7799
|
|
|
var errors []error |
7800
|
|
|
|
7801
|
|
|
if len(m.GetTenantId()) > 128 { |
7802
|
|
|
err := DataDeleteRequestValidationError{ |
7803
|
|
|
field: "TenantId", |
7804
|
|
|
reason: "value length must be at most 128 bytes", |
7805
|
|
|
} |
7806
|
|
|
if !all { |
7807
|
|
|
return err |
7808
|
|
|
} |
7809
|
|
|
errors = append(errors, err) |
7810
|
|
|
} |
7811
|
|
|
|
7812
|
|
|
if !_DataDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7813
|
|
|
err := DataDeleteRequestValidationError{ |
7814
|
|
|
field: "TenantId", |
7815
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7816
|
|
|
} |
7817
|
|
|
if !all { |
7818
|
|
|
return err |
7819
|
|
|
} |
7820
|
|
|
errors = append(errors, err) |
7821
|
|
|
} |
7822
|
|
|
|
7823
|
|
|
if m.GetTupleFilter() == nil { |
7824
|
|
|
err := DataDeleteRequestValidationError{ |
7825
|
|
|
field: "TupleFilter", |
7826
|
|
|
reason: "value is required", |
7827
|
|
|
} |
7828
|
|
|
if !all { |
7829
|
|
|
return err |
7830
|
|
|
} |
7831
|
|
|
errors = append(errors, err) |
7832
|
|
|
} |
7833
|
|
|
|
7834
|
|
|
if all { |
7835
|
|
|
switch v := interface{}(m.GetTupleFilter()).(type) { |
7836
|
|
|
case interface{ ValidateAll() error }: |
7837
|
|
|
if err := v.ValidateAll(); err != nil { |
7838
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7839
|
|
|
field: "TupleFilter", |
7840
|
|
|
reason: "embedded message failed validation", |
7841
|
|
|
cause: err, |
7842
|
|
|
}) |
7843
|
|
|
} |
7844
|
|
|
case interface{ Validate() error }: |
7845
|
|
|
if err := v.Validate(); err != nil { |
7846
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7847
|
|
|
field: "TupleFilter", |
7848
|
|
|
reason: "embedded message failed validation", |
7849
|
|
|
cause: err, |
7850
|
|
|
}) |
7851
|
|
|
} |
7852
|
|
|
} |
7853
|
|
|
} else if v, ok := interface{}(m.GetTupleFilter()).(interface{ Validate() error }); ok { |
7854
|
|
|
if err := v.Validate(); err != nil { |
7855
|
|
|
return DataDeleteRequestValidationError{ |
7856
|
|
|
field: "TupleFilter", |
7857
|
|
|
reason: "embedded message failed validation", |
7858
|
|
|
cause: err, |
7859
|
|
|
} |
7860
|
|
|
} |
7861
|
|
|
} |
7862
|
|
|
|
7863
|
|
|
if m.GetAttributeFilter() == nil { |
7864
|
|
|
err := DataDeleteRequestValidationError{ |
7865
|
|
|
field: "AttributeFilter", |
7866
|
|
|
reason: "value is required", |
7867
|
|
|
} |
7868
|
|
|
if !all { |
7869
|
|
|
return err |
7870
|
|
|
} |
7871
|
|
|
errors = append(errors, err) |
7872
|
|
|
} |
7873
|
|
|
|
7874
|
|
|
if all { |
7875
|
|
|
switch v := interface{}(m.GetAttributeFilter()).(type) { |
7876
|
|
|
case interface{ ValidateAll() error }: |
7877
|
|
|
if err := v.ValidateAll(); err != nil { |
7878
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7879
|
|
|
field: "AttributeFilter", |
7880
|
|
|
reason: "embedded message failed validation", |
7881
|
|
|
cause: err, |
7882
|
|
|
}) |
7883
|
|
|
} |
7884
|
|
|
case interface{ Validate() error }: |
7885
|
|
|
if err := v.Validate(); err != nil { |
7886
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7887
|
|
|
field: "AttributeFilter", |
7888
|
|
|
reason: "embedded message failed validation", |
7889
|
|
|
cause: err, |
7890
|
|
|
}) |
7891
|
|
|
} |
7892
|
|
|
} |
7893
|
|
|
} else if v, ok := interface{}(m.GetAttributeFilter()).(interface{ Validate() error }); ok { |
7894
|
|
|
if err := v.Validate(); err != nil { |
7895
|
|
|
return DataDeleteRequestValidationError{ |
7896
|
|
|
field: "AttributeFilter", |
7897
|
|
|
reason: "embedded message failed validation", |
7898
|
|
|
cause: err, |
7899
|
|
|
} |
7900
|
|
|
} |
7901
|
|
|
} |
7902
|
|
|
|
7903
|
|
|
if len(errors) > 0 { |
7904
|
|
|
return DataDeleteRequestMultiError(errors) |
7905
|
|
|
} |
7906
|
|
|
|
7907
|
|
|
return nil |
7908
|
|
|
} |
7909
|
|
|
|
7910
|
|
|
// DataDeleteRequestMultiError is an error wrapping multiple validation errors |
7911
|
|
|
// returned by DataDeleteRequest.ValidateAll() if the designated constraints |
7912
|
|
|
// aren't met. |
7913
|
|
|
type DataDeleteRequestMultiError []error |
7914
|
|
|
|
7915
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7916
|
|
|
func (m DataDeleteRequestMultiError) Error() string { |
7917
|
|
|
var msgs []string |
7918
|
|
|
for _, err := range m { |
7919
|
|
|
msgs = append(msgs, err.Error()) |
7920
|
|
|
} |
7921
|
|
|
return strings.Join(msgs, "; ") |
7922
|
|
|
} |
7923
|
|
|
|
7924
|
|
|
// AllErrors returns a list of validation violation errors. |
7925
|
|
|
func (m DataDeleteRequestMultiError) AllErrors() []error { return m } |
7926
|
|
|
|
7927
|
|
|
// DataDeleteRequestValidationError is the validation error returned by |
7928
|
|
|
// DataDeleteRequest.Validate if the designated constraints aren't met. |
7929
|
|
|
type DataDeleteRequestValidationError struct { |
7930
|
|
|
field string |
7931
|
|
|
reason string |
7932
|
|
|
cause error |
7933
|
|
|
key bool |
7934
|
|
|
} |
7935
|
|
|
|
7936
|
|
|
// Field function returns field value. |
7937
|
|
|
func (e DataDeleteRequestValidationError) Field() string { return e.field } |
7938
|
|
|
|
7939
|
|
|
// Reason function returns reason value. |
7940
|
|
|
func (e DataDeleteRequestValidationError) Reason() string { return e.reason } |
7941
|
|
|
|
7942
|
|
|
// Cause function returns cause value. |
7943
|
|
|
func (e DataDeleteRequestValidationError) Cause() error { return e.cause } |
7944
|
|
|
|
7945
|
|
|
// Key function returns key value. |
7946
|
|
|
func (e DataDeleteRequestValidationError) Key() bool { return e.key } |
7947
|
|
|
|
7948
|
|
|
// ErrorName returns error name. |
7949
|
|
|
func (e DataDeleteRequestValidationError) ErrorName() string { |
7950
|
|
|
return "DataDeleteRequestValidationError" |
7951
|
|
|
} |
7952
|
|
|
|
7953
|
|
|
// Error satisfies the builtin error interface |
7954
|
|
|
func (e DataDeleteRequestValidationError) Error() string { |
7955
|
|
|
cause := "" |
7956
|
|
|
if e.cause != nil { |
7957
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7958
|
|
|
} |
7959
|
|
|
|
7960
|
|
|
key := "" |
7961
|
|
|
if e.key { |
7962
|
|
|
key = "key for " |
7963
|
|
|
} |
7964
|
|
|
|
7965
|
|
|
return fmt.Sprintf( |
7966
|
|
|
"invalid %sDataDeleteRequest.%s: %s%s", |
7967
|
|
|
key, |
7968
|
|
|
e.field, |
7969
|
|
|
e.reason, |
7970
|
|
|
cause) |
7971
|
|
|
} |
7972
|
|
|
|
7973
|
|
|
var _ error = DataDeleteRequestValidationError{} |
7974
|
|
|
|
7975
|
|
|
var _ interface { |
7976
|
|
|
Field() string |
7977
|
|
|
Reason() string |
7978
|
|
|
Key() bool |
7979
|
|
|
Cause() error |
7980
|
|
|
ErrorName() string |
7981
|
|
|
} = DataDeleteRequestValidationError{} |
7982
|
|
|
|
7983
|
|
|
var _DataDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7984
|
|
|
|
7985
|
|
|
// Validate checks the field values on DataDeleteResponse with the rules |
7986
|
|
|
// defined in the proto definition for this message. If any rules are |
7987
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7988
|
|
|
func (m *DataDeleteResponse) Validate() error { |
7989
|
|
|
return m.validate(false) |
7990
|
|
|
} |
7991
|
|
|
|
7992
|
|
|
// ValidateAll checks the field values on DataDeleteResponse with the rules |
7993
|
|
|
// defined in the proto definition for this message. If any rules are |
7994
|
|
|
// violated, the result is a list of violation errors wrapped in |
7995
|
|
|
// DataDeleteResponseMultiError, or nil if none found. |
7996
|
|
|
func (m *DataDeleteResponse) ValidateAll() error { |
7997
|
|
|
return m.validate(true) |
7998
|
|
|
} |
7999
|
|
|
|
8000
|
|
|
func (m *DataDeleteResponse) validate(all bool) error { |
8001
|
|
|
if m == nil { |
8002
|
|
|
return nil |
8003
|
|
|
} |
8004
|
|
|
|
8005
|
|
|
var errors []error |
8006
|
|
|
|
8007
|
|
|
// no validation rules for SnapToken |
8008
|
|
|
|
8009
|
|
|
if len(errors) > 0 { |
8010
|
|
|
return DataDeleteResponseMultiError(errors) |
8011
|
|
|
} |
8012
|
|
|
|
8013
|
|
|
return nil |
8014
|
|
|
} |
8015
|
|
|
|
8016
|
|
|
// DataDeleteResponseMultiError is an error wrapping multiple validation errors |
8017
|
|
|
// returned by DataDeleteResponse.ValidateAll() if the designated constraints |
8018
|
|
|
// aren't met. |
8019
|
|
|
type DataDeleteResponseMultiError []error |
8020
|
|
|
|
8021
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8022
|
|
|
func (m DataDeleteResponseMultiError) Error() string { |
8023
|
|
|
var msgs []string |
8024
|
|
|
for _, err := range m { |
8025
|
|
|
msgs = append(msgs, err.Error()) |
8026
|
|
|
} |
8027
|
|
|
return strings.Join(msgs, "; ") |
8028
|
|
|
} |
8029
|
|
|
|
8030
|
|
|
// AllErrors returns a list of validation violation errors. |
8031
|
|
|
func (m DataDeleteResponseMultiError) AllErrors() []error { return m } |
8032
|
|
|
|
8033
|
|
|
// DataDeleteResponseValidationError is the validation error returned by |
8034
|
|
|
// DataDeleteResponse.Validate if the designated constraints aren't met. |
8035
|
|
|
type DataDeleteResponseValidationError struct { |
8036
|
|
|
field string |
8037
|
|
|
reason string |
8038
|
|
|
cause error |
8039
|
|
|
key bool |
8040
|
|
|
} |
8041
|
|
|
|
8042
|
|
|
// Field function returns field value. |
8043
|
|
|
func (e DataDeleteResponseValidationError) Field() string { return e.field } |
8044
|
|
|
|
8045
|
|
|
// Reason function returns reason value. |
8046
|
|
|
func (e DataDeleteResponseValidationError) Reason() string { return e.reason } |
8047
|
|
|
|
8048
|
|
|
// Cause function returns cause value. |
8049
|
|
|
func (e DataDeleteResponseValidationError) Cause() error { return e.cause } |
8050
|
|
|
|
8051
|
|
|
// Key function returns key value. |
8052
|
|
|
func (e DataDeleteResponseValidationError) Key() bool { return e.key } |
8053
|
|
|
|
8054
|
|
|
// ErrorName returns error name. |
8055
|
|
|
func (e DataDeleteResponseValidationError) ErrorName() string { |
8056
|
|
|
return "DataDeleteResponseValidationError" |
8057
|
|
|
} |
8058
|
|
|
|
8059
|
|
|
// Error satisfies the builtin error interface |
8060
|
|
|
func (e DataDeleteResponseValidationError) Error() string { |
8061
|
|
|
cause := "" |
8062
|
|
|
if e.cause != nil { |
8063
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8064
|
|
|
} |
8065
|
|
|
|
8066
|
|
|
key := "" |
8067
|
|
|
if e.key { |
8068
|
|
|
key = "key for " |
8069
|
|
|
} |
8070
|
|
|
|
8071
|
|
|
return fmt.Sprintf( |
8072
|
|
|
"invalid %sDataDeleteResponse.%s: %s%s", |
8073
|
|
|
key, |
8074
|
|
|
e.field, |
8075
|
|
|
e.reason, |
8076
|
|
|
cause) |
8077
|
|
|
} |
8078
|
|
|
|
8079
|
|
|
var _ error = DataDeleteResponseValidationError{} |
8080
|
|
|
|
8081
|
|
|
var _ interface { |
8082
|
|
|
Field() string |
8083
|
|
|
Reason() string |
8084
|
|
|
Key() bool |
8085
|
|
|
Cause() error |
8086
|
|
|
ErrorName() string |
8087
|
|
|
} = DataDeleteResponseValidationError{} |
8088
|
|
|
|
8089
|
|
|
// Validate checks the field values on RelationshipDeleteRequest with the rules |
8090
|
|
|
// defined in the proto definition for this message. If any rules are |
8091
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8092
|
|
|
func (m *RelationshipDeleteRequest) Validate() error { |
8093
|
|
|
return m.validate(false) |
8094
|
|
|
} |
8095
|
|
|
|
8096
|
|
|
// ValidateAll checks the field values on RelationshipDeleteRequest with the |
8097
|
|
|
// rules defined in the proto definition for this message. If any rules are |
8098
|
|
|
// violated, the result is a list of violation errors wrapped in |
8099
|
|
|
// RelationshipDeleteRequestMultiError, or nil if none found. |
8100
|
|
|
func (m *RelationshipDeleteRequest) ValidateAll() error { |
8101
|
|
|
return m.validate(true) |
8102
|
|
|
} |
8103
|
|
|
|
8104
|
|
|
func (m *RelationshipDeleteRequest) validate(all bool) error { |
8105
|
|
|
if m == nil { |
8106
|
|
|
return nil |
8107
|
|
|
} |
8108
|
|
|
|
8109
|
|
|
var errors []error |
8110
|
|
|
|
8111
|
|
|
if len(m.GetTenantId()) > 128 { |
8112
|
|
|
err := RelationshipDeleteRequestValidationError{ |
8113
|
|
|
field: "TenantId", |
8114
|
|
|
reason: "value length must be at most 128 bytes", |
8115
|
|
|
} |
8116
|
|
|
if !all { |
8117
|
|
|
return err |
8118
|
|
|
} |
8119
|
|
|
errors = append(errors, err) |
8120
|
|
|
} |
8121
|
|
|
|
8122
|
|
|
if !_RelationshipDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8123
|
|
|
err := RelationshipDeleteRequestValidationError{ |
8124
|
|
|
field: "TenantId", |
8125
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8126
|
|
|
} |
8127
|
|
|
if !all { |
8128
|
|
|
return err |
8129
|
|
|
} |
8130
|
|
|
errors = append(errors, err) |
8131
|
|
|
} |
8132
|
|
|
|
8133
|
|
|
if all { |
8134
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
8135
|
|
|
case interface{ ValidateAll() error }: |
8136
|
|
|
if err := v.ValidateAll(); err != nil { |
8137
|
|
|
errors = append(errors, RelationshipDeleteRequestValidationError{ |
8138
|
|
|
field: "Filter", |
8139
|
|
|
reason: "embedded message failed validation", |
8140
|
|
|
cause: err, |
8141
|
|
|
}) |
8142
|
|
|
} |
8143
|
|
|
case interface{ Validate() error }: |
8144
|
|
|
if err := v.Validate(); err != nil { |
8145
|
|
|
errors = append(errors, RelationshipDeleteRequestValidationError{ |
8146
|
|
|
field: "Filter", |
8147
|
|
|
reason: "embedded message failed validation", |
8148
|
|
|
cause: err, |
8149
|
|
|
}) |
8150
|
|
|
} |
8151
|
|
|
} |
8152
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
8153
|
|
|
if err := v.Validate(); err != nil { |
8154
|
|
|
return RelationshipDeleteRequestValidationError{ |
8155
|
|
|
field: "Filter", |
8156
|
|
|
reason: "embedded message failed validation", |
8157
|
|
|
cause: err, |
8158
|
|
|
} |
8159
|
|
|
} |
8160
|
|
|
} |
8161
|
|
|
|
8162
|
|
|
if len(errors) > 0 { |
8163
|
|
|
return RelationshipDeleteRequestMultiError(errors) |
8164
|
|
|
} |
8165
|
|
|
|
8166
|
|
|
return nil |
8167
|
|
|
} |
8168
|
|
|
|
8169
|
|
|
// RelationshipDeleteRequestMultiError is an error wrapping multiple validation |
8170
|
|
|
// errors returned by RelationshipDeleteRequest.ValidateAll() if the |
8171
|
|
|
// designated constraints aren't met. |
8172
|
|
|
type RelationshipDeleteRequestMultiError []error |
8173
|
|
|
|
8174
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8175
|
|
|
func (m RelationshipDeleteRequestMultiError) Error() string { |
8176
|
|
|
var msgs []string |
8177
|
|
|
for _, err := range m { |
8178
|
|
|
msgs = append(msgs, err.Error()) |
8179
|
|
|
} |
8180
|
|
|
return strings.Join(msgs, "; ") |
8181
|
|
|
} |
8182
|
|
|
|
8183
|
|
|
// AllErrors returns a list of validation violation errors. |
8184
|
|
|
func (m RelationshipDeleteRequestMultiError) AllErrors() []error { return m } |
8185
|
|
|
|
8186
|
|
|
// RelationshipDeleteRequestValidationError is the validation error returned by |
8187
|
|
|
// RelationshipDeleteRequest.Validate if the designated constraints aren't met. |
8188
|
|
|
type RelationshipDeleteRequestValidationError struct { |
8189
|
|
|
field string |
8190
|
|
|
reason string |
8191
|
|
|
cause error |
8192
|
|
|
key bool |
8193
|
|
|
} |
8194
|
|
|
|
8195
|
|
|
// Field function returns field value. |
8196
|
|
|
func (e RelationshipDeleteRequestValidationError) Field() string { return e.field } |
8197
|
|
|
|
8198
|
|
|
// Reason function returns reason value. |
8199
|
|
|
func (e RelationshipDeleteRequestValidationError) Reason() string { return e.reason } |
8200
|
|
|
|
8201
|
|
|
// Cause function returns cause value. |
8202
|
|
|
func (e RelationshipDeleteRequestValidationError) Cause() error { return e.cause } |
8203
|
|
|
|
8204
|
|
|
// Key function returns key value. |
8205
|
|
|
func (e RelationshipDeleteRequestValidationError) Key() bool { return e.key } |
8206
|
|
|
|
8207
|
|
|
// ErrorName returns error name. |
8208
|
|
|
func (e RelationshipDeleteRequestValidationError) ErrorName() string { |
8209
|
|
|
return "RelationshipDeleteRequestValidationError" |
8210
|
|
|
} |
8211
|
|
|
|
8212
|
|
|
// Error satisfies the builtin error interface |
8213
|
|
|
func (e RelationshipDeleteRequestValidationError) Error() string { |
8214
|
|
|
cause := "" |
8215
|
|
|
if e.cause != nil { |
8216
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8217
|
|
|
} |
8218
|
|
|
|
8219
|
|
|
key := "" |
8220
|
|
|
if e.key { |
8221
|
|
|
key = "key for " |
8222
|
|
|
} |
8223
|
|
|
|
8224
|
|
|
return fmt.Sprintf( |
8225
|
|
|
"invalid %sRelationshipDeleteRequest.%s: %s%s", |
8226
|
|
|
key, |
8227
|
|
|
e.field, |
8228
|
|
|
e.reason, |
8229
|
|
|
cause) |
8230
|
|
|
} |
8231
|
|
|
|
8232
|
|
|
var _ error = RelationshipDeleteRequestValidationError{} |
8233
|
|
|
|
8234
|
|
|
var _ interface { |
8235
|
|
|
Field() string |
8236
|
|
|
Reason() string |
8237
|
|
|
Key() bool |
8238
|
|
|
Cause() error |
8239
|
|
|
ErrorName() string |
8240
|
|
|
} = RelationshipDeleteRequestValidationError{} |
8241
|
|
|
|
8242
|
|
|
var _RelationshipDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8243
|
|
|
|
8244
|
|
|
// Validate checks the field values on RelationshipDeleteResponse with the |
8245
|
|
|
// rules defined in the proto definition for this message. If any rules are |
8246
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8247
|
|
|
func (m *RelationshipDeleteResponse) Validate() error { |
8248
|
|
|
return m.validate(false) |
8249
|
|
|
} |
8250
|
|
|
|
8251
|
|
|
// ValidateAll checks the field values on RelationshipDeleteResponse with the |
8252
|
|
|
// rules defined in the proto definition for this message. If any rules are |
8253
|
|
|
// violated, the result is a list of violation errors wrapped in |
8254
|
|
|
// RelationshipDeleteResponseMultiError, or nil if none found. |
8255
|
|
|
func (m *RelationshipDeleteResponse) ValidateAll() error { |
8256
|
|
|
return m.validate(true) |
8257
|
|
|
} |
8258
|
|
|
|
8259
|
|
|
func (m *RelationshipDeleteResponse) validate(all bool) error { |
8260
|
|
|
if m == nil { |
8261
|
|
|
return nil |
8262
|
|
|
} |
8263
|
|
|
|
8264
|
|
|
var errors []error |
8265
|
|
|
|
8266
|
|
|
// no validation rules for SnapToken |
8267
|
|
|
|
8268
|
|
|
if len(errors) > 0 { |
8269
|
|
|
return RelationshipDeleteResponseMultiError(errors) |
8270
|
|
|
} |
8271
|
|
|
|
8272
|
|
|
return nil |
8273
|
|
|
} |
8274
|
|
|
|
8275
|
|
|
// RelationshipDeleteResponseMultiError is an error wrapping multiple |
8276
|
|
|
// validation errors returned by RelationshipDeleteResponse.ValidateAll() if |
8277
|
|
|
// the designated constraints aren't met. |
8278
|
|
|
type RelationshipDeleteResponseMultiError []error |
8279
|
|
|
|
8280
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8281
|
|
|
func (m RelationshipDeleteResponseMultiError) Error() string { |
8282
|
|
|
var msgs []string |
8283
|
|
|
for _, err := range m { |
8284
|
|
|
msgs = append(msgs, err.Error()) |
8285
|
|
|
} |
8286
|
|
|
return strings.Join(msgs, "; ") |
8287
|
|
|
} |
8288
|
|
|
|
8289
|
|
|
// AllErrors returns a list of validation violation errors. |
8290
|
|
|
func (m RelationshipDeleteResponseMultiError) AllErrors() []error { return m } |
8291
|
|
|
|
8292
|
|
|
// RelationshipDeleteResponseValidationError is the validation error returned |
8293
|
|
|
// by RelationshipDeleteResponse.Validate if the designated constraints aren't met. |
8294
|
|
|
type RelationshipDeleteResponseValidationError struct { |
8295
|
|
|
field string |
8296
|
|
|
reason string |
8297
|
|
|
cause error |
8298
|
|
|
key bool |
8299
|
|
|
} |
8300
|
|
|
|
8301
|
|
|
// Field function returns field value. |
8302
|
|
|
func (e RelationshipDeleteResponseValidationError) Field() string { return e.field } |
8303
|
|
|
|
8304
|
|
|
// Reason function returns reason value. |
8305
|
|
|
func (e RelationshipDeleteResponseValidationError) Reason() string { return e.reason } |
8306
|
|
|
|
8307
|
|
|
// Cause function returns cause value. |
8308
|
|
|
func (e RelationshipDeleteResponseValidationError) Cause() error { return e.cause } |
8309
|
|
|
|
8310
|
|
|
// Key function returns key value. |
8311
|
|
|
func (e RelationshipDeleteResponseValidationError) Key() bool { return e.key } |
8312
|
|
|
|
8313
|
|
|
// ErrorName returns error name. |
8314
|
|
|
func (e RelationshipDeleteResponseValidationError) ErrorName() string { |
8315
|
|
|
return "RelationshipDeleteResponseValidationError" |
8316
|
|
|
} |
8317
|
|
|
|
8318
|
|
|
// Error satisfies the builtin error interface |
8319
|
|
|
func (e RelationshipDeleteResponseValidationError) Error() string { |
8320
|
|
|
cause := "" |
8321
|
|
|
if e.cause != nil { |
8322
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8323
|
|
|
} |
8324
|
|
|
|
8325
|
|
|
key := "" |
8326
|
|
|
if e.key { |
8327
|
|
|
key = "key for " |
8328
|
|
|
} |
8329
|
|
|
|
8330
|
|
|
return fmt.Sprintf( |
8331
|
|
|
"invalid %sRelationshipDeleteResponse.%s: %s%s", |
8332
|
|
|
key, |
8333
|
|
|
e.field, |
8334
|
|
|
e.reason, |
8335
|
|
|
cause) |
8336
|
|
|
} |
8337
|
|
|
|
8338
|
|
|
var _ error = RelationshipDeleteResponseValidationError{} |
8339
|
|
|
|
8340
|
|
|
var _ interface { |
8341
|
|
|
Field() string |
8342
|
|
|
Reason() string |
8343
|
|
|
Key() bool |
8344
|
|
|
Cause() error |
8345
|
|
|
ErrorName() string |
8346
|
|
|
} = RelationshipDeleteResponseValidationError{} |
8347
|
|
|
|
8348
|
|
|
// Validate checks the field values on BundleRunRequest with the rules defined |
8349
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8350
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8351
|
|
|
func (m *BundleRunRequest) Validate() error { |
8352
|
|
|
return m.validate(false) |
8353
|
|
|
} |
8354
|
|
|
|
8355
|
|
|
// ValidateAll checks the field values on BundleRunRequest with the rules |
8356
|
|
|
// defined in the proto definition for this message. If any rules are |
8357
|
|
|
// violated, the result is a list of violation errors wrapped in |
8358
|
|
|
// BundleRunRequestMultiError, or nil if none found. |
8359
|
|
|
func (m *BundleRunRequest) ValidateAll() error { |
8360
|
|
|
return m.validate(true) |
8361
|
|
|
} |
8362
|
|
|
|
8363
|
|
|
func (m *BundleRunRequest) validate(all bool) error { |
8364
|
|
|
if m == nil { |
8365
|
|
|
return nil |
8366
|
|
|
} |
8367
|
|
|
|
8368
|
|
|
var errors []error |
8369
|
|
|
|
8370
|
|
|
if len(m.GetTenantId()) > 128 { |
8371
|
|
|
err := BundleRunRequestValidationError{ |
8372
|
|
|
field: "TenantId", |
8373
|
|
|
reason: "value length must be at most 128 bytes", |
8374
|
|
|
} |
8375
|
|
|
if !all { |
8376
|
|
|
return err |
8377
|
|
|
} |
8378
|
|
|
errors = append(errors, err) |
8379
|
|
|
} |
8380
|
|
|
|
8381
|
|
|
if !_BundleRunRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8382
|
|
|
err := BundleRunRequestValidationError{ |
8383
|
|
|
field: "TenantId", |
8384
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8385
|
|
|
} |
8386
|
|
|
if !all { |
8387
|
|
|
return err |
8388
|
|
|
} |
8389
|
|
|
errors = append(errors, err) |
8390
|
|
|
} |
8391
|
|
|
|
8392
|
|
|
// no validation rules for Name |
8393
|
|
|
|
8394
|
|
|
// no validation rules for Arguments |
8395
|
|
|
|
8396
|
|
|
if len(errors) > 0 { |
8397
|
|
|
return BundleRunRequestMultiError(errors) |
8398
|
|
|
} |
8399
|
|
|
|
8400
|
|
|
return nil |
8401
|
|
|
} |
8402
|
|
|
|
8403
|
|
|
// BundleRunRequestMultiError is an error wrapping multiple validation errors |
8404
|
|
|
// returned by BundleRunRequest.ValidateAll() if the designated constraints |
8405
|
|
|
// aren't met. |
8406
|
|
|
type BundleRunRequestMultiError []error |
8407
|
|
|
|
8408
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8409
|
|
|
func (m BundleRunRequestMultiError) Error() string { |
8410
|
|
|
var msgs []string |
8411
|
|
|
for _, err := range m { |
8412
|
|
|
msgs = append(msgs, err.Error()) |
8413
|
|
|
} |
8414
|
|
|
return strings.Join(msgs, "; ") |
8415
|
|
|
} |
8416
|
|
|
|
8417
|
|
|
// AllErrors returns a list of validation violation errors. |
8418
|
|
|
func (m BundleRunRequestMultiError) AllErrors() []error { return m } |
8419
|
|
|
|
8420
|
|
|
// BundleRunRequestValidationError is the validation error returned by |
8421
|
|
|
// BundleRunRequest.Validate if the designated constraints aren't met. |
8422
|
|
|
type BundleRunRequestValidationError struct { |
8423
|
|
|
field string |
8424
|
|
|
reason string |
8425
|
|
|
cause error |
8426
|
|
|
key bool |
8427
|
|
|
} |
8428
|
|
|
|
8429
|
|
|
// Field function returns field value. |
8430
|
|
|
func (e BundleRunRequestValidationError) Field() string { return e.field } |
8431
|
|
|
|
8432
|
|
|
// Reason function returns reason value. |
8433
|
|
|
func (e BundleRunRequestValidationError) Reason() string { return e.reason } |
8434
|
|
|
|
8435
|
|
|
// Cause function returns cause value. |
8436
|
|
|
func (e BundleRunRequestValidationError) Cause() error { return e.cause } |
8437
|
|
|
|
8438
|
|
|
// Key function returns key value. |
8439
|
|
|
func (e BundleRunRequestValidationError) Key() bool { return e.key } |
8440
|
|
|
|
8441
|
|
|
// ErrorName returns error name. |
8442
|
|
|
func (e BundleRunRequestValidationError) ErrorName() string { return "BundleRunRequestValidationError" } |
8443
|
|
|
|
8444
|
|
|
// Error satisfies the builtin error interface |
8445
|
|
|
func (e BundleRunRequestValidationError) Error() string { |
8446
|
|
|
cause := "" |
8447
|
|
|
if e.cause != nil { |
8448
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8449
|
|
|
} |
8450
|
|
|
|
8451
|
|
|
key := "" |
8452
|
|
|
if e.key { |
8453
|
|
|
key = "key for " |
8454
|
|
|
} |
8455
|
|
|
|
8456
|
|
|
return fmt.Sprintf( |
8457
|
|
|
"invalid %sBundleRunRequest.%s: %s%s", |
8458
|
|
|
key, |
8459
|
|
|
e.field, |
8460
|
|
|
e.reason, |
8461
|
|
|
cause) |
8462
|
|
|
} |
8463
|
|
|
|
8464
|
|
|
var _ error = BundleRunRequestValidationError{} |
8465
|
|
|
|
8466
|
|
|
var _ interface { |
8467
|
|
|
Field() string |
8468
|
|
|
Reason() string |
8469
|
|
|
Key() bool |
8470
|
|
|
Cause() error |
8471
|
|
|
ErrorName() string |
8472
|
|
|
} = BundleRunRequestValidationError{} |
8473
|
|
|
|
8474
|
|
|
var _BundleRunRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8475
|
|
|
|
8476
|
|
|
// Validate checks the field values on BundleRunResponse with the rules defined |
8477
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8478
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8479
|
|
|
func (m *BundleRunResponse) Validate() error { |
8480
|
|
|
return m.validate(false) |
8481
|
|
|
} |
8482
|
|
|
|
8483
|
|
|
// ValidateAll checks the field values on BundleRunResponse with the rules |
8484
|
|
|
// defined in the proto definition for this message. If any rules are |
8485
|
|
|
// violated, the result is a list of violation errors wrapped in |
8486
|
|
|
// BundleRunResponseMultiError, or nil if none found. |
8487
|
|
|
func (m *BundleRunResponse) ValidateAll() error { |
8488
|
|
|
return m.validate(true) |
8489
|
|
|
} |
8490
|
|
|
|
8491
|
|
|
func (m *BundleRunResponse) validate(all bool) error { |
8492
|
|
|
if m == nil { |
8493
|
|
|
return nil |
8494
|
|
|
} |
8495
|
|
|
|
8496
|
|
|
var errors []error |
8497
|
|
|
|
8498
|
|
|
// no validation rules for SnapToken |
8499
|
|
|
|
8500
|
|
|
if len(errors) > 0 { |
8501
|
|
|
return BundleRunResponseMultiError(errors) |
8502
|
|
|
} |
8503
|
|
|
|
8504
|
|
|
return nil |
8505
|
|
|
} |
8506
|
|
|
|
8507
|
|
|
// BundleRunResponseMultiError is an error wrapping multiple validation errors |
8508
|
|
|
// returned by BundleRunResponse.ValidateAll() if the designated constraints |
8509
|
|
|
// aren't met. |
8510
|
|
|
type BundleRunResponseMultiError []error |
8511
|
|
|
|
8512
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8513
|
|
|
func (m BundleRunResponseMultiError) Error() string { |
8514
|
|
|
var msgs []string |
8515
|
|
|
for _, err := range m { |
8516
|
|
|
msgs = append(msgs, err.Error()) |
8517
|
|
|
} |
8518
|
|
|
return strings.Join(msgs, "; ") |
8519
|
|
|
} |
8520
|
|
|
|
8521
|
|
|
// AllErrors returns a list of validation violation errors. |
8522
|
|
|
func (m BundleRunResponseMultiError) AllErrors() []error { return m } |
8523
|
|
|
|
8524
|
|
|
// BundleRunResponseValidationError is the validation error returned by |
8525
|
|
|
// BundleRunResponse.Validate if the designated constraints aren't met. |
8526
|
|
|
type BundleRunResponseValidationError struct { |
8527
|
|
|
field string |
8528
|
|
|
reason string |
8529
|
|
|
cause error |
8530
|
|
|
key bool |
8531
|
|
|
} |
8532
|
|
|
|
8533
|
|
|
// Field function returns field value. |
8534
|
|
|
func (e BundleRunResponseValidationError) Field() string { return e.field } |
8535
|
|
|
|
8536
|
|
|
// Reason function returns reason value. |
8537
|
|
|
func (e BundleRunResponseValidationError) Reason() string { return e.reason } |
8538
|
|
|
|
8539
|
|
|
// Cause function returns cause value. |
8540
|
|
|
func (e BundleRunResponseValidationError) Cause() error { return e.cause } |
8541
|
|
|
|
8542
|
|
|
// Key function returns key value. |
8543
|
|
|
func (e BundleRunResponseValidationError) Key() bool { return e.key } |
8544
|
|
|
|
8545
|
|
|
// ErrorName returns error name. |
8546
|
|
|
func (e BundleRunResponseValidationError) ErrorName() string { |
8547
|
|
|
return "BundleRunResponseValidationError" |
8548
|
|
|
} |
8549
|
|
|
|
8550
|
|
|
// Error satisfies the builtin error interface |
8551
|
|
|
func (e BundleRunResponseValidationError) Error() string { |
8552
|
|
|
cause := "" |
8553
|
|
|
if e.cause != nil { |
8554
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8555
|
|
|
} |
8556
|
|
|
|
8557
|
|
|
key := "" |
8558
|
|
|
if e.key { |
8559
|
|
|
key = "key for " |
8560
|
|
|
} |
8561
|
|
|
|
8562
|
|
|
return fmt.Sprintf( |
8563
|
|
|
"invalid %sBundleRunResponse.%s: %s%s", |
8564
|
|
|
key, |
8565
|
|
|
e.field, |
8566
|
|
|
e.reason, |
8567
|
|
|
cause) |
8568
|
|
|
} |
8569
|
|
|
|
8570
|
|
|
var _ error = BundleRunResponseValidationError{} |
8571
|
|
|
|
8572
|
|
|
var _ interface { |
8573
|
|
|
Field() string |
8574
|
|
|
Reason() string |
8575
|
|
|
Key() bool |
8576
|
|
|
Cause() error |
8577
|
|
|
ErrorName() string |
8578
|
|
|
} = BundleRunResponseValidationError{} |
8579
|
|
|
|
8580
|
|
|
// Validate checks the field values on BundleWriteRequest with the rules |
8581
|
|
|
// defined in the proto definition for this message. If any rules are |
8582
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8583
|
|
|
func (m *BundleWriteRequest) Validate() error { |
8584
|
|
|
return m.validate(false) |
8585
|
|
|
} |
8586
|
|
|
|
8587
|
|
|
// ValidateAll checks the field values on BundleWriteRequest with the rules |
8588
|
|
|
// defined in the proto definition for this message. If any rules are |
8589
|
|
|
// violated, the result is a list of violation errors wrapped in |
8590
|
|
|
// BundleWriteRequestMultiError, or nil if none found. |
8591
|
|
|
func (m *BundleWriteRequest) ValidateAll() error { |
8592
|
|
|
return m.validate(true) |
8593
|
|
|
} |
8594
|
|
|
|
8595
|
|
|
func (m *BundleWriteRequest) validate(all bool) error { |
8596
|
|
|
if m == nil { |
8597
|
|
|
return nil |
8598
|
|
|
} |
8599
|
|
|
|
8600
|
|
|
var errors []error |
8601
|
|
|
|
8602
|
|
|
if len(m.GetTenantId()) > 128 { |
8603
|
|
|
err := BundleWriteRequestValidationError{ |
8604
|
|
|
field: "TenantId", |
8605
|
|
|
reason: "value length must be at most 128 bytes", |
8606
|
|
|
} |
8607
|
|
|
if !all { |
8608
|
|
|
return err |
8609
|
|
|
} |
8610
|
|
|
errors = append(errors, err) |
8611
|
|
|
} |
8612
|
|
|
|
8613
|
|
|
if !_BundleWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8614
|
|
|
err := BundleWriteRequestValidationError{ |
8615
|
|
|
field: "TenantId", |
8616
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8617
|
|
|
} |
8618
|
|
|
if !all { |
8619
|
|
|
return err |
8620
|
|
|
} |
8621
|
|
|
errors = append(errors, err) |
8622
|
|
|
} |
8623
|
|
|
|
8624
|
|
|
for idx, item := range m.GetBundles() { |
8625
|
|
|
_, _ = idx, item |
8626
|
|
|
|
8627
|
|
|
if all { |
8628
|
|
|
switch v := interface{}(item).(type) { |
8629
|
|
|
case interface{ ValidateAll() error }: |
8630
|
|
|
if err := v.ValidateAll(); err != nil { |
8631
|
|
|
errors = append(errors, BundleWriteRequestValidationError{ |
8632
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
8633
|
|
|
reason: "embedded message failed validation", |
8634
|
|
|
cause: err, |
8635
|
|
|
}) |
8636
|
|
|
} |
8637
|
|
|
case interface{ Validate() error }: |
8638
|
|
|
if err := v.Validate(); err != nil { |
8639
|
|
|
errors = append(errors, BundleWriteRequestValidationError{ |
8640
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
8641
|
|
|
reason: "embedded message failed validation", |
8642
|
|
|
cause: err, |
8643
|
|
|
}) |
8644
|
|
|
} |
8645
|
|
|
} |
8646
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
8647
|
|
|
if err := v.Validate(); err != nil { |
8648
|
|
|
return BundleWriteRequestValidationError{ |
8649
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
8650
|
|
|
reason: "embedded message failed validation", |
8651
|
|
|
cause: err, |
8652
|
|
|
} |
8653
|
|
|
} |
8654
|
|
|
} |
8655
|
|
|
|
8656
|
|
|
} |
8657
|
|
|
|
8658
|
|
|
if len(errors) > 0 { |
8659
|
|
|
return BundleWriteRequestMultiError(errors) |
8660
|
|
|
} |
8661
|
|
|
|
8662
|
|
|
return nil |
8663
|
|
|
} |
8664
|
|
|
|
8665
|
|
|
// BundleWriteRequestMultiError is an error wrapping multiple validation errors |
8666
|
|
|
// returned by BundleWriteRequest.ValidateAll() if the designated constraints |
8667
|
|
|
// aren't met. |
8668
|
|
|
type BundleWriteRequestMultiError []error |
8669
|
|
|
|
8670
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8671
|
|
|
func (m BundleWriteRequestMultiError) Error() string { |
8672
|
|
|
var msgs []string |
8673
|
|
|
for _, err := range m { |
8674
|
|
|
msgs = append(msgs, err.Error()) |
8675
|
|
|
} |
8676
|
|
|
return strings.Join(msgs, "; ") |
8677
|
|
|
} |
8678
|
|
|
|
8679
|
|
|
// AllErrors returns a list of validation violation errors. |
8680
|
|
|
func (m BundleWriteRequestMultiError) AllErrors() []error { return m } |
8681
|
|
|
|
8682
|
|
|
// BundleWriteRequestValidationError is the validation error returned by |
8683
|
|
|
// BundleWriteRequest.Validate if the designated constraints aren't met. |
8684
|
|
|
type BundleWriteRequestValidationError struct { |
8685
|
|
|
field string |
8686
|
|
|
reason string |
8687
|
|
|
cause error |
8688
|
|
|
key bool |
8689
|
|
|
} |
8690
|
|
|
|
8691
|
|
|
// Field function returns field value. |
8692
|
|
|
func (e BundleWriteRequestValidationError) Field() string { return e.field } |
8693
|
|
|
|
8694
|
|
|
// Reason function returns reason value. |
8695
|
|
|
func (e BundleWriteRequestValidationError) Reason() string { return e.reason } |
8696
|
|
|
|
8697
|
|
|
// Cause function returns cause value. |
8698
|
|
|
func (e BundleWriteRequestValidationError) Cause() error { return e.cause } |
8699
|
|
|
|
8700
|
|
|
// Key function returns key value. |
8701
|
|
|
func (e BundleWriteRequestValidationError) Key() bool { return e.key } |
8702
|
|
|
|
8703
|
|
|
// ErrorName returns error name. |
8704
|
|
|
func (e BundleWriteRequestValidationError) ErrorName() string { |
8705
|
|
|
return "BundleWriteRequestValidationError" |
8706
|
|
|
} |
8707
|
|
|
|
8708
|
|
|
// Error satisfies the builtin error interface |
8709
|
|
|
func (e BundleWriteRequestValidationError) Error() string { |
8710
|
|
|
cause := "" |
8711
|
|
|
if e.cause != nil { |
8712
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8713
|
|
|
} |
8714
|
|
|
|
8715
|
|
|
key := "" |
8716
|
|
|
if e.key { |
8717
|
|
|
key = "key for " |
8718
|
|
|
} |
8719
|
|
|
|
8720
|
|
|
return fmt.Sprintf( |
8721
|
|
|
"invalid %sBundleWriteRequest.%s: %s%s", |
8722
|
|
|
key, |
8723
|
|
|
e.field, |
8724
|
|
|
e.reason, |
8725
|
|
|
cause) |
8726
|
|
|
} |
8727
|
|
|
|
8728
|
|
|
var _ error = BundleWriteRequestValidationError{} |
8729
|
|
|
|
8730
|
|
|
var _ interface { |
8731
|
|
|
Field() string |
8732
|
|
|
Reason() string |
8733
|
|
|
Key() bool |
8734
|
|
|
Cause() error |
8735
|
|
|
ErrorName() string |
8736
|
|
|
} = BundleWriteRequestValidationError{} |
8737
|
|
|
|
8738
|
|
|
var _BundleWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8739
|
|
|
|
8740
|
|
|
// Validate checks the field values on BundleWriteResponse with the rules |
8741
|
|
|
// defined in the proto definition for this message. If any rules are |
8742
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8743
|
|
|
func (m *BundleWriteResponse) Validate() error { |
8744
|
|
|
return m.validate(false) |
8745
|
|
|
} |
8746
|
|
|
|
8747
|
|
|
// ValidateAll checks the field values on BundleWriteResponse with the rules |
8748
|
|
|
// defined in the proto definition for this message. If any rules are |
8749
|
|
|
// violated, the result is a list of violation errors wrapped in |
8750
|
|
|
// BundleWriteResponseMultiError, or nil if none found. |
8751
|
|
|
func (m *BundleWriteResponse) ValidateAll() error { |
8752
|
|
|
return m.validate(true) |
8753
|
|
|
} |
8754
|
|
|
|
8755
|
|
|
func (m *BundleWriteResponse) validate(all bool) error { |
8756
|
|
|
if m == nil { |
8757
|
|
|
return nil |
8758
|
|
|
} |
8759
|
|
|
|
8760
|
|
|
var errors []error |
8761
|
|
|
|
8762
|
|
|
if len(errors) > 0 { |
8763
|
|
|
return BundleWriteResponseMultiError(errors) |
8764
|
|
|
} |
8765
|
|
|
|
8766
|
|
|
return nil |
8767
|
|
|
} |
8768
|
|
|
|
8769
|
|
|
// BundleWriteResponseMultiError is an error wrapping multiple validation |
8770
|
|
|
// errors returned by BundleWriteResponse.ValidateAll() if the designated |
8771
|
|
|
// constraints aren't met. |
8772
|
|
|
type BundleWriteResponseMultiError []error |
8773
|
|
|
|
8774
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8775
|
|
|
func (m BundleWriteResponseMultiError) Error() string { |
8776
|
|
|
var msgs []string |
8777
|
|
|
for _, err := range m { |
8778
|
|
|
msgs = append(msgs, err.Error()) |
8779
|
|
|
} |
8780
|
|
|
return strings.Join(msgs, "; ") |
8781
|
|
|
} |
8782
|
|
|
|
8783
|
|
|
// AllErrors returns a list of validation violation errors. |
8784
|
|
|
func (m BundleWriteResponseMultiError) AllErrors() []error { return m } |
8785
|
|
|
|
8786
|
|
|
// BundleWriteResponseValidationError is the validation error returned by |
8787
|
|
|
// BundleWriteResponse.Validate if the designated constraints aren't met. |
8788
|
|
|
type BundleWriteResponseValidationError struct { |
8789
|
|
|
field string |
8790
|
|
|
reason string |
8791
|
|
|
cause error |
8792
|
|
|
key bool |
8793
|
|
|
} |
8794
|
|
|
|
8795
|
|
|
// Field function returns field value. |
8796
|
|
|
func (e BundleWriteResponseValidationError) Field() string { return e.field } |
8797
|
|
|
|
8798
|
|
|
// Reason function returns reason value. |
8799
|
|
|
func (e BundleWriteResponseValidationError) Reason() string { return e.reason } |
8800
|
|
|
|
8801
|
|
|
// Cause function returns cause value. |
8802
|
|
|
func (e BundleWriteResponseValidationError) Cause() error { return e.cause } |
8803
|
|
|
|
8804
|
|
|
// Key function returns key value. |
8805
|
|
|
func (e BundleWriteResponseValidationError) Key() bool { return e.key } |
8806
|
|
|
|
8807
|
|
|
// ErrorName returns error name. |
8808
|
|
|
func (e BundleWriteResponseValidationError) ErrorName() string { |
8809
|
|
|
return "BundleWriteResponseValidationError" |
8810
|
|
|
} |
8811
|
|
|
|
8812
|
|
|
// Error satisfies the builtin error interface |
8813
|
|
|
func (e BundleWriteResponseValidationError) Error() string { |
8814
|
|
|
cause := "" |
8815
|
|
|
if e.cause != nil { |
8816
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8817
|
|
|
} |
8818
|
|
|
|
8819
|
|
|
key := "" |
8820
|
|
|
if e.key { |
8821
|
|
|
key = "key for " |
8822
|
|
|
} |
8823
|
|
|
|
8824
|
|
|
return fmt.Sprintf( |
8825
|
|
|
"invalid %sBundleWriteResponse.%s: %s%s", |
8826
|
|
|
key, |
8827
|
|
|
e.field, |
8828
|
|
|
e.reason, |
8829
|
|
|
cause) |
8830
|
|
|
} |
8831
|
|
|
|
8832
|
|
|
var _ error = BundleWriteResponseValidationError{} |
8833
|
|
|
|
8834
|
|
|
var _ interface { |
8835
|
|
|
Field() string |
8836
|
|
|
Reason() string |
8837
|
|
|
Key() bool |
8838
|
|
|
Cause() error |
8839
|
|
|
ErrorName() string |
8840
|
|
|
} = BundleWriteResponseValidationError{} |
8841
|
|
|
|
8842
|
|
|
// Validate checks the field values on BundleReadRequest with the rules defined |
8843
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8844
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8845
|
|
|
func (m *BundleReadRequest) Validate() error { |
8846
|
|
|
return m.validate(false) |
8847
|
|
|
} |
8848
|
|
|
|
8849
|
|
|
// ValidateAll checks the field values on BundleReadRequest with the rules |
8850
|
|
|
// defined in the proto definition for this message. If any rules are |
8851
|
|
|
// violated, the result is a list of violation errors wrapped in |
8852
|
|
|
// BundleReadRequestMultiError, or nil if none found. |
8853
|
|
|
func (m *BundleReadRequest) ValidateAll() error { |
8854
|
|
|
return m.validate(true) |
8855
|
|
|
} |
8856
|
|
|
|
8857
|
|
|
func (m *BundleReadRequest) validate(all bool) error { |
8858
|
|
|
if m == nil { |
8859
|
|
|
return nil |
8860
|
|
|
} |
8861
|
|
|
|
8862
|
|
|
var errors []error |
8863
|
|
|
|
8864
|
|
|
if len(m.GetTenantId()) > 128 { |
8865
|
|
|
err := BundleReadRequestValidationError{ |
8866
|
|
|
field: "TenantId", |
8867
|
|
|
reason: "value length must be at most 128 bytes", |
8868
|
|
|
} |
8869
|
|
|
if !all { |
8870
|
|
|
return err |
8871
|
|
|
} |
8872
|
|
|
errors = append(errors, err) |
8873
|
|
|
} |
8874
|
|
|
|
8875
|
|
|
if !_BundleReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8876
|
|
|
err := BundleReadRequestValidationError{ |
8877
|
|
|
field: "TenantId", |
8878
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8879
|
|
|
} |
8880
|
|
|
if !all { |
8881
|
|
|
return err |
8882
|
|
|
} |
8883
|
|
|
errors = append(errors, err) |
8884
|
|
|
} |
8885
|
|
|
|
8886
|
|
|
// no validation rules for Name |
8887
|
|
|
|
8888
|
|
|
if len(errors) > 0 { |
8889
|
|
|
return BundleReadRequestMultiError(errors) |
8890
|
|
|
} |
8891
|
|
|
|
8892
|
|
|
return nil |
8893
|
|
|
} |
8894
|
|
|
|
8895
|
|
|
// BundleReadRequestMultiError is an error wrapping multiple validation errors |
8896
|
|
|
// returned by BundleReadRequest.ValidateAll() if the designated constraints |
8897
|
|
|
// aren't met. |
8898
|
|
|
type BundleReadRequestMultiError []error |
8899
|
|
|
|
8900
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8901
|
|
|
func (m BundleReadRequestMultiError) Error() string { |
8902
|
|
|
var msgs []string |
8903
|
|
|
for _, err := range m { |
8904
|
|
|
msgs = append(msgs, err.Error()) |
8905
|
|
|
} |
8906
|
|
|
return strings.Join(msgs, "; ") |
8907
|
|
|
} |
8908
|
|
|
|
8909
|
|
|
// AllErrors returns a list of validation violation errors. |
8910
|
|
|
func (m BundleReadRequestMultiError) AllErrors() []error { return m } |
8911
|
|
|
|
8912
|
|
|
// BundleReadRequestValidationError is the validation error returned by |
8913
|
|
|
// BundleReadRequest.Validate if the designated constraints aren't met. |
8914
|
|
|
type BundleReadRequestValidationError struct { |
8915
|
|
|
field string |
8916
|
|
|
reason string |
8917
|
|
|
cause error |
8918
|
|
|
key bool |
8919
|
|
|
} |
8920
|
|
|
|
8921
|
|
|
// Field function returns field value. |
8922
|
|
|
func (e BundleReadRequestValidationError) Field() string { return e.field } |
8923
|
|
|
|
8924
|
|
|
// Reason function returns reason value. |
8925
|
|
|
func (e BundleReadRequestValidationError) Reason() string { return e.reason } |
8926
|
|
|
|
8927
|
|
|
// Cause function returns cause value. |
8928
|
|
|
func (e BundleReadRequestValidationError) Cause() error { return e.cause } |
8929
|
|
|
|
8930
|
|
|
// Key function returns key value. |
8931
|
|
|
func (e BundleReadRequestValidationError) Key() bool { return e.key } |
8932
|
|
|
|
8933
|
|
|
// ErrorName returns error name. |
8934
|
|
|
func (e BundleReadRequestValidationError) ErrorName() string { |
8935
|
|
|
return "BundleReadRequestValidationError" |
8936
|
|
|
} |
8937
|
|
|
|
8938
|
|
|
// Error satisfies the builtin error interface |
8939
|
|
|
func (e BundleReadRequestValidationError) Error() string { |
8940
|
|
|
cause := "" |
8941
|
|
|
if e.cause != nil { |
8942
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8943
|
|
|
} |
8944
|
|
|
|
8945
|
|
|
key := "" |
8946
|
|
|
if e.key { |
8947
|
|
|
key = "key for " |
8948
|
|
|
} |
8949
|
|
|
|
8950
|
|
|
return fmt.Sprintf( |
8951
|
|
|
"invalid %sBundleReadRequest.%s: %s%s", |
8952
|
|
|
key, |
8953
|
|
|
e.field, |
8954
|
|
|
e.reason, |
8955
|
|
|
cause) |
8956
|
|
|
} |
8957
|
|
|
|
8958
|
|
|
var _ error = BundleReadRequestValidationError{} |
8959
|
|
|
|
8960
|
|
|
var _ interface { |
8961
|
|
|
Field() string |
8962
|
|
|
Reason() string |
8963
|
|
|
Key() bool |
8964
|
|
|
Cause() error |
8965
|
|
|
ErrorName() string |
8966
|
|
|
} = BundleReadRequestValidationError{} |
8967
|
|
|
|
8968
|
|
|
var _BundleReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8969
|
|
|
|
8970
|
|
|
// Validate checks the field values on BundleReadResponse with the rules |
8971
|
|
|
// defined in the proto definition for this message. If any rules are |
8972
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8973
|
|
|
func (m *BundleReadResponse) Validate() error { |
8974
|
|
|
return m.validate(false) |
8975
|
|
|
} |
8976
|
|
|
|
8977
|
|
|
// ValidateAll checks the field values on BundleReadResponse with the rules |
8978
|
|
|
// defined in the proto definition for this message. If any rules are |
8979
|
|
|
// violated, the result is a list of violation errors wrapped in |
8980
|
|
|
// BundleReadResponseMultiError, or nil if none found. |
8981
|
|
|
func (m *BundleReadResponse) ValidateAll() error { |
8982
|
|
|
return m.validate(true) |
8983
|
|
|
} |
8984
|
|
|
|
8985
|
|
|
func (m *BundleReadResponse) validate(all bool) error { |
8986
|
|
|
if m == nil { |
8987
|
|
|
return nil |
8988
|
|
|
} |
8989
|
|
|
|
8990
|
|
|
var errors []error |
8991
|
|
|
|
8992
|
|
|
if all { |
8993
|
|
|
switch v := interface{}(m.GetBundle()).(type) { |
8994
|
|
|
case interface{ ValidateAll() error }: |
8995
|
|
|
if err := v.ValidateAll(); err != nil { |
8996
|
|
|
errors = append(errors, BundleReadResponseValidationError{ |
8997
|
|
|
field: "Bundle", |
8998
|
|
|
reason: "embedded message failed validation", |
8999
|
|
|
cause: err, |
9000
|
|
|
}) |
9001
|
|
|
} |
9002
|
|
|
case interface{ Validate() error }: |
9003
|
|
|
if err := v.Validate(); err != nil { |
9004
|
|
|
errors = append(errors, BundleReadResponseValidationError{ |
9005
|
|
|
field: "Bundle", |
9006
|
|
|
reason: "embedded message failed validation", |
9007
|
|
|
cause: err, |
9008
|
|
|
}) |
9009
|
|
|
} |
9010
|
|
|
} |
9011
|
|
|
} else if v, ok := interface{}(m.GetBundle()).(interface{ Validate() error }); ok { |
9012
|
|
|
if err := v.Validate(); err != nil { |
9013
|
|
|
return BundleReadResponseValidationError{ |
9014
|
|
|
field: "Bundle", |
9015
|
|
|
reason: "embedded message failed validation", |
9016
|
|
|
cause: err, |
9017
|
|
|
} |
9018
|
|
|
} |
9019
|
|
|
} |
9020
|
|
|
|
9021
|
|
|
if len(errors) > 0 { |
9022
|
|
|
return BundleReadResponseMultiError(errors) |
9023
|
|
|
} |
9024
|
|
|
|
9025
|
|
|
return nil |
9026
|
|
|
} |
9027
|
|
|
|
9028
|
|
|
// BundleReadResponseMultiError is an error wrapping multiple validation errors |
9029
|
|
|
// returned by BundleReadResponse.ValidateAll() if the designated constraints |
9030
|
|
|
// aren't met. |
9031
|
|
|
type BundleReadResponseMultiError []error |
9032
|
|
|
|
9033
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9034
|
|
|
func (m BundleReadResponseMultiError) Error() string { |
9035
|
|
|
var msgs []string |
9036
|
|
|
for _, err := range m { |
9037
|
|
|
msgs = append(msgs, err.Error()) |
9038
|
|
|
} |
9039
|
|
|
return strings.Join(msgs, "; ") |
9040
|
|
|
} |
9041
|
|
|
|
9042
|
|
|
// AllErrors returns a list of validation violation errors. |
9043
|
|
|
func (m BundleReadResponseMultiError) AllErrors() []error { return m } |
9044
|
|
|
|
9045
|
|
|
// BundleReadResponseValidationError is the validation error returned by |
9046
|
|
|
// BundleReadResponse.Validate if the designated constraints aren't met. |
9047
|
|
|
type BundleReadResponseValidationError struct { |
9048
|
|
|
field string |
9049
|
|
|
reason string |
9050
|
|
|
cause error |
9051
|
|
|
key bool |
9052
|
|
|
} |
9053
|
|
|
|
9054
|
|
|
// Field function returns field value. |
9055
|
|
|
func (e BundleReadResponseValidationError) Field() string { return e.field } |
9056
|
|
|
|
9057
|
|
|
// Reason function returns reason value. |
9058
|
|
|
func (e BundleReadResponseValidationError) Reason() string { return e.reason } |
9059
|
|
|
|
9060
|
|
|
// Cause function returns cause value. |
9061
|
|
|
func (e BundleReadResponseValidationError) Cause() error { return e.cause } |
9062
|
|
|
|
9063
|
|
|
// Key function returns key value. |
9064
|
|
|
func (e BundleReadResponseValidationError) Key() bool { return e.key } |
9065
|
|
|
|
9066
|
|
|
// ErrorName returns error name. |
9067
|
|
|
func (e BundleReadResponseValidationError) ErrorName() string { |
9068
|
|
|
return "BundleReadResponseValidationError" |
9069
|
|
|
} |
9070
|
|
|
|
9071
|
|
|
// Error satisfies the builtin error interface |
9072
|
|
|
func (e BundleReadResponseValidationError) Error() string { |
9073
|
|
|
cause := "" |
9074
|
|
|
if e.cause != nil { |
9075
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9076
|
|
|
} |
9077
|
|
|
|
9078
|
|
|
key := "" |
9079
|
|
|
if e.key { |
9080
|
|
|
key = "key for " |
9081
|
|
|
} |
9082
|
|
|
|
9083
|
|
|
return fmt.Sprintf( |
9084
|
|
|
"invalid %sBundleReadResponse.%s: %s%s", |
9085
|
|
|
key, |
9086
|
|
|
e.field, |
9087
|
|
|
e.reason, |
9088
|
|
|
cause) |
9089
|
|
|
} |
9090
|
|
|
|
9091
|
|
|
var _ error = BundleReadResponseValidationError{} |
9092
|
|
|
|
9093
|
|
|
var _ interface { |
9094
|
|
|
Field() string |
9095
|
|
|
Reason() string |
9096
|
|
|
Key() bool |
9097
|
|
|
Cause() error |
9098
|
|
|
ErrorName() string |
9099
|
|
|
} = BundleReadResponseValidationError{} |
9100
|
|
|
|
9101
|
|
|
// Validate checks the field values on BundleDeleteRequest with the rules |
9102
|
|
|
// defined in the proto definition for this message. If any rules are |
9103
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9104
|
|
|
func (m *BundleDeleteRequest) Validate() error { |
9105
|
|
|
return m.validate(false) |
9106
|
|
|
} |
9107
|
|
|
|
9108
|
|
|
// ValidateAll checks the field values on BundleDeleteRequest with the rules |
9109
|
|
|
// defined in the proto definition for this message. If any rules are |
9110
|
|
|
// violated, the result is a list of violation errors wrapped in |
9111
|
|
|
// BundleDeleteRequestMultiError, or nil if none found. |
9112
|
|
|
func (m *BundleDeleteRequest) ValidateAll() error { |
9113
|
|
|
return m.validate(true) |
9114
|
|
|
} |
9115
|
|
|
|
9116
|
|
|
func (m *BundleDeleteRequest) validate(all bool) error { |
9117
|
|
|
if m == nil { |
9118
|
|
|
return nil |
9119
|
|
|
} |
9120
|
|
|
|
9121
|
|
|
var errors []error |
9122
|
|
|
|
9123
|
|
|
if len(m.GetTenantId()) > 128 { |
9124
|
|
|
err := BundleDeleteRequestValidationError{ |
9125
|
|
|
field: "TenantId", |
9126
|
|
|
reason: "value length must be at most 128 bytes", |
9127
|
|
|
} |
9128
|
|
|
if !all { |
9129
|
|
|
return err |
9130
|
|
|
} |
9131
|
|
|
errors = append(errors, err) |
9132
|
|
|
} |
9133
|
|
|
|
9134
|
|
|
if !_BundleDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
9135
|
|
|
err := BundleDeleteRequestValidationError{ |
9136
|
|
|
field: "TenantId", |
9137
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
9138
|
|
|
} |
9139
|
|
|
if !all { |
9140
|
|
|
return err |
9141
|
|
|
} |
9142
|
|
|
errors = append(errors, err) |
9143
|
|
|
} |
9144
|
|
|
|
9145
|
|
|
// no validation rules for Name |
9146
|
|
|
|
9147
|
|
|
if len(errors) > 0 { |
9148
|
|
|
return BundleDeleteRequestMultiError(errors) |
9149
|
|
|
} |
9150
|
|
|
|
9151
|
|
|
return nil |
9152
|
|
|
} |
9153
|
|
|
|
9154
|
|
|
// BundleDeleteRequestMultiError is an error wrapping multiple validation |
9155
|
|
|
// errors returned by BundleDeleteRequest.ValidateAll() if the designated |
9156
|
|
|
// constraints aren't met. |
9157
|
|
|
type BundleDeleteRequestMultiError []error |
9158
|
|
|
|
9159
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9160
|
|
|
func (m BundleDeleteRequestMultiError) Error() string { |
9161
|
|
|
var msgs []string |
9162
|
|
|
for _, err := range m { |
9163
|
|
|
msgs = append(msgs, err.Error()) |
9164
|
|
|
} |
9165
|
|
|
return strings.Join(msgs, "; ") |
9166
|
|
|
} |
9167
|
|
|
|
9168
|
|
|
// AllErrors returns a list of validation violation errors. |
9169
|
|
|
func (m BundleDeleteRequestMultiError) AllErrors() []error { return m } |
9170
|
|
|
|
9171
|
|
|
// BundleDeleteRequestValidationError is the validation error returned by |
9172
|
|
|
// BundleDeleteRequest.Validate if the designated constraints aren't met. |
9173
|
|
|
type BundleDeleteRequestValidationError struct { |
9174
|
|
|
field string |
9175
|
|
|
reason string |
9176
|
|
|
cause error |
9177
|
|
|
key bool |
9178
|
|
|
} |
9179
|
|
|
|
9180
|
|
|
// Field function returns field value. |
9181
|
|
|
func (e BundleDeleteRequestValidationError) Field() string { return e.field } |
9182
|
|
|
|
9183
|
|
|
// Reason function returns reason value. |
9184
|
|
|
func (e BundleDeleteRequestValidationError) Reason() string { return e.reason } |
9185
|
|
|
|
9186
|
|
|
// Cause function returns cause value. |
9187
|
|
|
func (e BundleDeleteRequestValidationError) Cause() error { return e.cause } |
9188
|
|
|
|
9189
|
|
|
// Key function returns key value. |
9190
|
|
|
func (e BundleDeleteRequestValidationError) Key() bool { return e.key } |
9191
|
|
|
|
9192
|
|
|
// ErrorName returns error name. |
9193
|
|
|
func (e BundleDeleteRequestValidationError) ErrorName() string { |
9194
|
|
|
return "BundleDeleteRequestValidationError" |
9195
|
|
|
} |
9196
|
|
|
|
9197
|
|
|
// Error satisfies the builtin error interface |
9198
|
|
|
func (e BundleDeleteRequestValidationError) Error() string { |
9199
|
|
|
cause := "" |
9200
|
|
|
if e.cause != nil { |
9201
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9202
|
|
|
} |
9203
|
|
|
|
9204
|
|
|
key := "" |
9205
|
|
|
if e.key { |
9206
|
|
|
key = "key for " |
9207
|
|
|
} |
9208
|
|
|
|
9209
|
|
|
return fmt.Sprintf( |
9210
|
|
|
"invalid %sBundleDeleteRequest.%s: %s%s", |
9211
|
|
|
key, |
9212
|
|
|
e.field, |
9213
|
|
|
e.reason, |
9214
|
|
|
cause) |
9215
|
|
|
} |
9216
|
|
|
|
9217
|
|
|
var _ error = BundleDeleteRequestValidationError{} |
9218
|
|
|
|
9219
|
|
|
var _ interface { |
9220
|
|
|
Field() string |
9221
|
|
|
Reason() string |
9222
|
|
|
Key() bool |
9223
|
|
|
Cause() error |
9224
|
|
|
ErrorName() string |
9225
|
|
|
} = BundleDeleteRequestValidationError{} |
9226
|
|
|
|
9227
|
|
|
var _BundleDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
9228
|
|
|
|
9229
|
|
|
// Validate checks the field values on BundleDeleteResponse with the rules |
9230
|
|
|
// defined in the proto definition for this message. If any rules are |
9231
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9232
|
|
|
func (m *BundleDeleteResponse) Validate() error { |
9233
|
|
|
return m.validate(false) |
9234
|
|
|
} |
9235
|
|
|
|
9236
|
|
|
// ValidateAll checks the field values on BundleDeleteResponse with the rules |
9237
|
|
|
// defined in the proto definition for this message. If any rules are |
9238
|
|
|
// violated, the result is a list of violation errors wrapped in |
9239
|
|
|
// BundleDeleteResponseMultiError, or nil if none found. |
9240
|
|
|
func (m *BundleDeleteResponse) ValidateAll() error { |
9241
|
|
|
return m.validate(true) |
9242
|
|
|
} |
9243
|
|
|
|
9244
|
|
|
func (m *BundleDeleteResponse) validate(all bool) error { |
9245
|
|
|
if m == nil { |
9246
|
|
|
return nil |
9247
|
|
|
} |
9248
|
|
|
|
9249
|
|
|
var errors []error |
9250
|
|
|
|
9251
|
|
|
// no validation rules for Name |
9252
|
|
|
|
9253
|
|
|
if len(errors) > 0 { |
9254
|
|
|
return BundleDeleteResponseMultiError(errors) |
9255
|
|
|
} |
9256
|
|
|
|
9257
|
|
|
return nil |
9258
|
|
|
} |
9259
|
|
|
|
9260
|
|
|
// BundleDeleteResponseMultiError is an error wrapping multiple validation |
9261
|
|
|
// errors returned by BundleDeleteResponse.ValidateAll() if the designated |
9262
|
|
|
// constraints aren't met. |
9263
|
|
|
type BundleDeleteResponseMultiError []error |
9264
|
|
|
|
9265
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9266
|
|
|
func (m BundleDeleteResponseMultiError) Error() string { |
9267
|
|
|
var msgs []string |
9268
|
|
|
for _, err := range m { |
9269
|
|
|
msgs = append(msgs, err.Error()) |
9270
|
|
|
} |
9271
|
|
|
return strings.Join(msgs, "; ") |
9272
|
|
|
} |
9273
|
|
|
|
9274
|
|
|
// AllErrors returns a list of validation violation errors. |
9275
|
|
|
func (m BundleDeleteResponseMultiError) AllErrors() []error { return m } |
9276
|
|
|
|
9277
|
|
|
// BundleDeleteResponseValidationError is the validation error returned by |
9278
|
|
|
// BundleDeleteResponse.Validate if the designated constraints aren't met. |
9279
|
|
|
type BundleDeleteResponseValidationError struct { |
9280
|
|
|
field string |
9281
|
|
|
reason string |
9282
|
|
|
cause error |
9283
|
|
|
key bool |
9284
|
|
|
} |
9285
|
|
|
|
9286
|
|
|
// Field function returns field value. |
9287
|
|
|
func (e BundleDeleteResponseValidationError) Field() string { return e.field } |
9288
|
|
|
|
9289
|
|
|
// Reason function returns reason value. |
9290
|
|
|
func (e BundleDeleteResponseValidationError) Reason() string { return e.reason } |
9291
|
|
|
|
9292
|
|
|
// Cause function returns cause value. |
9293
|
|
|
func (e BundleDeleteResponseValidationError) Cause() error { return e.cause } |
9294
|
|
|
|
9295
|
|
|
// Key function returns key value. |
9296
|
|
|
func (e BundleDeleteResponseValidationError) Key() bool { return e.key } |
9297
|
|
|
|
9298
|
|
|
// ErrorName returns error name. |
9299
|
|
|
func (e BundleDeleteResponseValidationError) ErrorName() string { |
9300
|
|
|
return "BundleDeleteResponseValidationError" |
9301
|
|
|
} |
9302
|
|
|
|
9303
|
|
|
// Error satisfies the builtin error interface |
9304
|
|
|
func (e BundleDeleteResponseValidationError) Error() string { |
9305
|
|
|
cause := "" |
9306
|
|
|
if e.cause != nil { |
9307
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9308
|
|
|
} |
9309
|
|
|
|
9310
|
|
|
key := "" |
9311
|
|
|
if e.key { |
9312
|
|
|
key = "key for " |
9313
|
|
|
} |
9314
|
|
|
|
9315
|
|
|
return fmt.Sprintf( |
9316
|
|
|
"invalid %sBundleDeleteResponse.%s: %s%s", |
9317
|
|
|
key, |
9318
|
|
|
e.field, |
9319
|
|
|
e.reason, |
9320
|
|
|
cause) |
9321
|
|
|
} |
9322
|
|
|
|
9323
|
|
|
var _ error = BundleDeleteResponseValidationError{} |
9324
|
|
|
|
9325
|
|
|
var _ interface { |
9326
|
|
|
Field() string |
9327
|
|
|
Reason() string |
9328
|
|
|
Key() bool |
9329
|
|
|
Cause() error |
9330
|
|
|
ErrorName() string |
9331
|
|
|
} = BundleDeleteResponseValidationError{} |
9332
|
|
|
|
9333
|
|
|
// Validate checks the field values on TenantCreateRequest with the rules |
9334
|
|
|
// defined in the proto definition for this message. If any rules are |
9335
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9336
|
|
|
func (m *TenantCreateRequest) Validate() error { |
9337
|
|
|
return m.validate(false) |
9338
|
|
|
} |
9339
|
|
|
|
9340
|
|
|
// ValidateAll checks the field values on TenantCreateRequest with the rules |
9341
|
|
|
// defined in the proto definition for this message. If any rules are |
9342
|
|
|
// violated, the result is a list of violation errors wrapped in |
9343
|
|
|
// TenantCreateRequestMultiError, or nil if none found. |
9344
|
|
|
func (m *TenantCreateRequest) ValidateAll() error { |
9345
|
|
|
return m.validate(true) |
9346
|
|
|
} |
9347
|
|
|
|
9348
|
|
|
func (m *TenantCreateRequest) validate(all bool) error { |
9349
|
|
|
if m == nil { |
9350
|
|
|
return nil |
9351
|
|
|
} |
9352
|
|
|
|
9353
|
|
|
var errors []error |
9354
|
|
|
|
9355
|
|
|
if len(m.GetId()) > 64 { |
9356
|
|
|
err := TenantCreateRequestValidationError{ |
9357
|
|
|
field: "Id", |
9358
|
|
|
reason: "value length must be at most 64 bytes", |
9359
|
|
|
} |
9360
|
|
|
if !all { |
9361
|
|
|
return err |
9362
|
|
|
} |
9363
|
|
|
errors = append(errors, err) |
9364
|
|
|
} |
9365
|
|
|
|
9366
|
|
|
if !_TenantCreateRequest_Id_Pattern.MatchString(m.GetId()) { |
9367
|
|
|
err := TenantCreateRequestValidationError{ |
9368
|
|
|
field: "Id", |
9369
|
|
|
reason: "value does not match regex pattern \"[a-zA-Z0-9-,]+\"", |
9370
|
|
|
} |
9371
|
|
|
if !all { |
9372
|
|
|
return err |
9373
|
|
|
} |
9374
|
|
|
errors = append(errors, err) |
9375
|
|
|
} |
9376
|
|
|
|
9377
|
|
|
if len(m.GetName()) > 64 { |
9378
|
|
|
err := TenantCreateRequestValidationError{ |
9379
|
|
|
field: "Name", |
9380
|
|
|
reason: "value length must be at most 64 bytes", |
9381
|
|
|
} |
9382
|
|
|
if !all { |
9383
|
|
|
return err |
9384
|
|
|
} |
9385
|
|
|
errors = append(errors, err) |
9386
|
|
|
} |
9387
|
|
|
|
9388
|
|
|
if len(errors) > 0 { |
9389
|
|
|
return TenantCreateRequestMultiError(errors) |
9390
|
|
|
} |
9391
|
|
|
|
9392
|
|
|
return nil |
9393
|
|
|
} |
9394
|
|
|
|
9395
|
|
|
// TenantCreateRequestMultiError is an error wrapping multiple validation |
9396
|
|
|
// errors returned by TenantCreateRequest.ValidateAll() if the designated |
9397
|
|
|
// constraints aren't met. |
9398
|
|
|
type TenantCreateRequestMultiError []error |
9399
|
|
|
|
9400
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9401
|
|
|
func (m TenantCreateRequestMultiError) Error() string { |
9402
|
|
|
var msgs []string |
9403
|
|
|
for _, err := range m { |
9404
|
|
|
msgs = append(msgs, err.Error()) |
9405
|
|
|
} |
9406
|
|
|
return strings.Join(msgs, "; ") |
9407
|
|
|
} |
9408
|
|
|
|
9409
|
|
|
// AllErrors returns a list of validation violation errors. |
9410
|
|
|
func (m TenantCreateRequestMultiError) AllErrors() []error { return m } |
9411
|
|
|
|
9412
|
|
|
// TenantCreateRequestValidationError is the validation error returned by |
9413
|
|
|
// TenantCreateRequest.Validate if the designated constraints aren't met. |
9414
|
|
|
type TenantCreateRequestValidationError struct { |
9415
|
|
|
field string |
9416
|
|
|
reason string |
9417
|
|
|
cause error |
9418
|
|
|
key bool |
9419
|
|
|
} |
9420
|
|
|
|
9421
|
|
|
// Field function returns field value. |
9422
|
|
|
func (e TenantCreateRequestValidationError) Field() string { return e.field } |
9423
|
|
|
|
9424
|
|
|
// Reason function returns reason value. |
9425
|
|
|
func (e TenantCreateRequestValidationError) Reason() string { return e.reason } |
9426
|
|
|
|
9427
|
|
|
// Cause function returns cause value. |
9428
|
|
|
func (e TenantCreateRequestValidationError) Cause() error { return e.cause } |
9429
|
|
|
|
9430
|
|
|
// Key function returns key value. |
9431
|
|
|
func (e TenantCreateRequestValidationError) Key() bool { return e.key } |
9432
|
|
|
|
9433
|
|
|
// ErrorName returns error name. |
9434
|
|
|
func (e TenantCreateRequestValidationError) ErrorName() string { |
9435
|
|
|
return "TenantCreateRequestValidationError" |
9436
|
|
|
} |
9437
|
|
|
|
9438
|
|
|
// Error satisfies the builtin error interface |
9439
|
|
|
func (e TenantCreateRequestValidationError) Error() string { |
9440
|
|
|
cause := "" |
9441
|
|
|
if e.cause != nil { |
9442
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9443
|
|
|
} |
9444
|
|
|
|
9445
|
|
|
key := "" |
9446
|
|
|
if e.key { |
9447
|
|
|
key = "key for " |
9448
|
|
|
} |
9449
|
|
|
|
9450
|
|
|
return fmt.Sprintf( |
9451
|
|
|
"invalid %sTenantCreateRequest.%s: %s%s", |
9452
|
|
|
key, |
9453
|
|
|
e.field, |
9454
|
|
|
e.reason, |
9455
|
|
|
cause) |
9456
|
|
|
} |
9457
|
|
|
|
9458
|
|
|
var _ error = TenantCreateRequestValidationError{} |
9459
|
|
|
|
9460
|
|
|
var _ interface { |
9461
|
|
|
Field() string |
9462
|
|
|
Reason() string |
9463
|
|
|
Key() bool |
9464
|
|
|
Cause() error |
9465
|
|
|
ErrorName() string |
9466
|
|
|
} = TenantCreateRequestValidationError{} |
9467
|
|
|
|
9468
|
|
|
var _TenantCreateRequest_Id_Pattern = regexp.MustCompile("[a-zA-Z0-9-,]+") |
9469
|
|
|
|
9470
|
|
|
// Validate checks the field values on TenantCreateResponse with the rules |
9471
|
|
|
// defined in the proto definition for this message. If any rules are |
9472
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9473
|
|
|
func (m *TenantCreateResponse) Validate() error { |
9474
|
|
|
return m.validate(false) |
9475
|
|
|
} |
9476
|
|
|
|
9477
|
|
|
// ValidateAll checks the field values on TenantCreateResponse with the rules |
9478
|
|
|
// defined in the proto definition for this message. If any rules are |
9479
|
|
|
// violated, the result is a list of violation errors wrapped in |
9480
|
|
|
// TenantCreateResponseMultiError, or nil if none found. |
9481
|
|
|
func (m *TenantCreateResponse) ValidateAll() error { |
9482
|
|
|
return m.validate(true) |
9483
|
|
|
} |
9484
|
|
|
|
9485
|
|
|
func (m *TenantCreateResponse) validate(all bool) error { |
9486
|
|
|
if m == nil { |
9487
|
|
|
return nil |
9488
|
|
|
} |
9489
|
|
|
|
9490
|
|
|
var errors []error |
9491
|
|
|
|
9492
|
|
|
if all { |
9493
|
|
|
switch v := interface{}(m.GetTenant()).(type) { |
9494
|
|
|
case interface{ ValidateAll() error }: |
9495
|
|
|
if err := v.ValidateAll(); err != nil { |
9496
|
|
|
errors = append(errors, TenantCreateResponseValidationError{ |
9497
|
|
|
field: "Tenant", |
9498
|
|
|
reason: "embedded message failed validation", |
9499
|
|
|
cause: err, |
9500
|
|
|
}) |
9501
|
|
|
} |
9502
|
|
|
case interface{ Validate() error }: |
9503
|
|
|
if err := v.Validate(); err != nil { |
9504
|
|
|
errors = append(errors, TenantCreateResponseValidationError{ |
9505
|
|
|
field: "Tenant", |
9506
|
|
|
reason: "embedded message failed validation", |
9507
|
|
|
cause: err, |
9508
|
|
|
}) |
9509
|
|
|
} |
9510
|
|
|
} |
9511
|
|
|
} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok { |
9512
|
|
|
if err := v.Validate(); err != nil { |
9513
|
|
|
return TenantCreateResponseValidationError{ |
9514
|
|
|
field: "Tenant", |
9515
|
|
|
reason: "embedded message failed validation", |
9516
|
|
|
cause: err, |
9517
|
|
|
} |
9518
|
|
|
} |
9519
|
|
|
} |
9520
|
|
|
|
9521
|
|
|
if len(errors) > 0 { |
9522
|
|
|
return TenantCreateResponseMultiError(errors) |
9523
|
|
|
} |
9524
|
|
|
|
9525
|
|
|
return nil |
9526
|
|
|
} |
9527
|
|
|
|
9528
|
|
|
// TenantCreateResponseMultiError is an error wrapping multiple validation |
9529
|
|
|
// errors returned by TenantCreateResponse.ValidateAll() if the designated |
9530
|
|
|
// constraints aren't met. |
9531
|
|
|
type TenantCreateResponseMultiError []error |
9532
|
|
|
|
9533
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9534
|
|
|
func (m TenantCreateResponseMultiError) Error() string { |
9535
|
|
|
var msgs []string |
9536
|
|
|
for _, err := range m { |
9537
|
|
|
msgs = append(msgs, err.Error()) |
9538
|
|
|
} |
9539
|
|
|
return strings.Join(msgs, "; ") |
9540
|
|
|
} |
9541
|
|
|
|
9542
|
|
|
// AllErrors returns a list of validation violation errors. |
9543
|
|
|
func (m TenantCreateResponseMultiError) AllErrors() []error { return m } |
9544
|
|
|
|
9545
|
|
|
// TenantCreateResponseValidationError is the validation error returned by |
9546
|
|
|
// TenantCreateResponse.Validate if the designated constraints aren't met. |
9547
|
|
|
type TenantCreateResponseValidationError struct { |
9548
|
|
|
field string |
9549
|
|
|
reason string |
9550
|
|
|
cause error |
9551
|
|
|
key bool |
9552
|
|
|
} |
9553
|
|
|
|
9554
|
|
|
// Field function returns field value. |
9555
|
|
|
func (e TenantCreateResponseValidationError) Field() string { return e.field } |
9556
|
|
|
|
9557
|
|
|
// Reason function returns reason value. |
9558
|
|
|
func (e TenantCreateResponseValidationError) Reason() string { return e.reason } |
9559
|
|
|
|
9560
|
|
|
// Cause function returns cause value. |
9561
|
|
|
func (e TenantCreateResponseValidationError) Cause() error { return e.cause } |
9562
|
|
|
|
9563
|
|
|
// Key function returns key value. |
9564
|
|
|
func (e TenantCreateResponseValidationError) Key() bool { return e.key } |
9565
|
|
|
|
9566
|
|
|
// ErrorName returns error name. |
9567
|
|
|
func (e TenantCreateResponseValidationError) ErrorName() string { |
9568
|
|
|
return "TenantCreateResponseValidationError" |
9569
|
|
|
} |
9570
|
|
|
|
9571
|
|
|
// Error satisfies the builtin error interface |
9572
|
|
|
func (e TenantCreateResponseValidationError) Error() string { |
9573
|
|
|
cause := "" |
9574
|
|
|
if e.cause != nil { |
9575
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9576
|
|
|
} |
9577
|
|
|
|
9578
|
|
|
key := "" |
9579
|
|
|
if e.key { |
9580
|
|
|
key = "key for " |
9581
|
|
|
} |
9582
|
|
|
|
9583
|
|
|
return fmt.Sprintf( |
9584
|
|
|
"invalid %sTenantCreateResponse.%s: %s%s", |
9585
|
|
|
key, |
9586
|
|
|
e.field, |
9587
|
|
|
e.reason, |
9588
|
|
|
cause) |
9589
|
|
|
} |
9590
|
|
|
|
9591
|
|
|
var _ error = TenantCreateResponseValidationError{} |
9592
|
|
|
|
9593
|
|
|
var _ interface { |
9594
|
|
|
Field() string |
9595
|
|
|
Reason() string |
9596
|
|
|
Key() bool |
9597
|
|
|
Cause() error |
9598
|
|
|
ErrorName() string |
9599
|
|
|
} = TenantCreateResponseValidationError{} |
9600
|
|
|
|
9601
|
|
|
// Validate checks the field values on TenantDeleteRequest with the rules |
9602
|
|
|
// defined in the proto definition for this message. If any rules are |
9603
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9604
|
|
|
func (m *TenantDeleteRequest) Validate() error { |
9605
|
|
|
return m.validate(false) |
9606
|
|
|
} |
9607
|
|
|
|
9608
|
|
|
// ValidateAll checks the field values on TenantDeleteRequest with the rules |
9609
|
|
|
// defined in the proto definition for this message. If any rules are |
9610
|
|
|
// violated, the result is a list of violation errors wrapped in |
9611
|
|
|
// TenantDeleteRequestMultiError, or nil if none found. |
9612
|
|
|
func (m *TenantDeleteRequest) ValidateAll() error { |
9613
|
|
|
return m.validate(true) |
9614
|
|
|
} |
9615
|
|
|
|
9616
|
|
|
func (m *TenantDeleteRequest) validate(all bool) error { |
9617
|
|
|
if m == nil { |
9618
|
|
|
return nil |
9619
|
|
|
} |
9620
|
|
|
|
9621
|
|
|
var errors []error |
9622
|
|
|
|
9623
|
|
|
if len(errors) > 0 { |
9624
|
|
|
return TenantDeleteRequestMultiError(errors) |
9625
|
|
|
} |
9626
|
|
|
|
9627
|
|
|
return nil |
9628
|
|
|
} |
9629
|
|
|
|
9630
|
|
|
// TenantDeleteRequestMultiError is an error wrapping multiple validation |
9631
|
|
|
// errors returned by TenantDeleteRequest.ValidateAll() if the designated |
9632
|
|
|
// constraints aren't met. |
9633
|
|
|
type TenantDeleteRequestMultiError []error |
9634
|
|
|
|
9635
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9636
|
|
|
func (m TenantDeleteRequestMultiError) Error() string { |
9637
|
|
|
var msgs []string |
9638
|
|
|
for _, err := range m { |
9639
|
|
|
msgs = append(msgs, err.Error()) |
9640
|
|
|
} |
9641
|
|
|
return strings.Join(msgs, "; ") |
9642
|
|
|
} |
9643
|
|
|
|
9644
|
|
|
// AllErrors returns a list of validation violation errors. |
9645
|
|
|
func (m TenantDeleteRequestMultiError) AllErrors() []error { return m } |
9646
|
|
|
|
9647
|
|
|
// TenantDeleteRequestValidationError is the validation error returned by |
9648
|
|
|
// TenantDeleteRequest.Validate if the designated constraints aren't met. |
9649
|
|
|
type TenantDeleteRequestValidationError struct { |
9650
|
|
|
field string |
9651
|
|
|
reason string |
9652
|
|
|
cause error |
9653
|
|
|
key bool |
9654
|
|
|
} |
9655
|
|
|
|
9656
|
|
|
// Field function returns field value. |
9657
|
|
|
func (e TenantDeleteRequestValidationError) Field() string { return e.field } |
9658
|
|
|
|
9659
|
|
|
// Reason function returns reason value. |
9660
|
|
|
func (e TenantDeleteRequestValidationError) Reason() string { return e.reason } |
9661
|
|
|
|
9662
|
|
|
// Cause function returns cause value. |
9663
|
|
|
func (e TenantDeleteRequestValidationError) Cause() error { return e.cause } |
9664
|
|
|
|
9665
|
|
|
// Key function returns key value. |
9666
|
|
|
func (e TenantDeleteRequestValidationError) Key() bool { return e.key } |
9667
|
|
|
|
9668
|
|
|
// ErrorName returns error name. |
9669
|
|
|
func (e TenantDeleteRequestValidationError) ErrorName() string { |
9670
|
|
|
return "TenantDeleteRequestValidationError" |
9671
|
|
|
} |
9672
|
|
|
|
9673
|
|
|
// Error satisfies the builtin error interface |
9674
|
|
|
func (e TenantDeleteRequestValidationError) Error() string { |
9675
|
|
|
cause := "" |
9676
|
|
|
if e.cause != nil { |
9677
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9678
|
|
|
} |
9679
|
|
|
|
9680
|
|
|
key := "" |
9681
|
|
|
if e.key { |
9682
|
|
|
key = "key for " |
9683
|
|
|
} |
9684
|
|
|
|
9685
|
|
|
return fmt.Sprintf( |
9686
|
|
|
"invalid %sTenantDeleteRequest.%s: %s%s", |
9687
|
|
|
key, |
9688
|
|
|
e.field, |
9689
|
|
|
e.reason, |
9690
|
|
|
cause) |
9691
|
|
|
} |
9692
|
|
|
|
9693
|
|
|
var _ error = TenantDeleteRequestValidationError{} |
9694
|
|
|
|
9695
|
|
|
var _ interface { |
9696
|
|
|
Field() string |
9697
|
|
|
Reason() string |
9698
|
|
|
Key() bool |
9699
|
|
|
Cause() error |
9700
|
|
|
ErrorName() string |
9701
|
|
|
} = TenantDeleteRequestValidationError{} |
9702
|
|
|
|
9703
|
|
|
// Validate checks the field values on TenantDeleteResponse with the rules |
9704
|
|
|
// defined in the proto definition for this message. If any rules are |
9705
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9706
|
|
|
func (m *TenantDeleteResponse) Validate() error { |
9707
|
|
|
return m.validate(false) |
9708
|
|
|
} |
9709
|
|
|
|
9710
|
|
|
// ValidateAll checks the field values on TenantDeleteResponse with the rules |
9711
|
|
|
// defined in the proto definition for this message. If any rules are |
9712
|
|
|
// violated, the result is a list of violation errors wrapped in |
9713
|
|
|
// TenantDeleteResponseMultiError, or nil if none found. |
9714
|
|
|
func (m *TenantDeleteResponse) ValidateAll() error { |
9715
|
|
|
return m.validate(true) |
9716
|
|
|
} |
9717
|
|
|
|
9718
|
|
|
func (m *TenantDeleteResponse) validate(all bool) error { |
9719
|
|
|
if m == nil { |
9720
|
|
|
return nil |
9721
|
|
|
} |
9722
|
|
|
|
9723
|
|
|
var errors []error |
9724
|
|
|
|
9725
|
|
|
if all { |
9726
|
|
|
switch v := interface{}(m.GetTenant()).(type) { |
9727
|
|
|
case interface{ ValidateAll() error }: |
9728
|
|
|
if err := v.ValidateAll(); err != nil { |
9729
|
|
|
errors = append(errors, TenantDeleteResponseValidationError{ |
9730
|
|
|
field: "Tenant", |
9731
|
|
|
reason: "embedded message failed validation", |
9732
|
|
|
cause: err, |
9733
|
|
|
}) |
9734
|
|
|
} |
9735
|
|
|
case interface{ Validate() error }: |
9736
|
|
|
if err := v.Validate(); err != nil { |
9737
|
|
|
errors = append(errors, TenantDeleteResponseValidationError{ |
9738
|
|
|
field: "Tenant", |
9739
|
|
|
reason: "embedded message failed validation", |
9740
|
|
|
cause: err, |
9741
|
|
|
}) |
9742
|
|
|
} |
9743
|
|
|
} |
9744
|
|
|
} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok { |
9745
|
|
|
if err := v.Validate(); err != nil { |
9746
|
|
|
return TenantDeleteResponseValidationError{ |
9747
|
|
|
field: "Tenant", |
9748
|
|
|
reason: "embedded message failed validation", |
9749
|
|
|
cause: err, |
9750
|
|
|
} |
9751
|
|
|
} |
9752
|
|
|
} |
9753
|
|
|
|
9754
|
|
|
if len(errors) > 0 { |
9755
|
|
|
return TenantDeleteResponseMultiError(errors) |
9756
|
|
|
} |
9757
|
|
|
|
9758
|
|
|
return nil |
9759
|
|
|
} |
9760
|
|
|
|
9761
|
|
|
// TenantDeleteResponseMultiError is an error wrapping multiple validation |
9762
|
|
|
// errors returned by TenantDeleteResponse.ValidateAll() if the designated |
9763
|
|
|
// constraints aren't met. |
9764
|
|
|
type TenantDeleteResponseMultiError []error |
9765
|
|
|
|
9766
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9767
|
|
|
func (m TenantDeleteResponseMultiError) Error() string { |
9768
|
|
|
var msgs []string |
9769
|
|
|
for _, err := range m { |
9770
|
|
|
msgs = append(msgs, err.Error()) |
9771
|
|
|
} |
9772
|
|
|
return strings.Join(msgs, "; ") |
9773
|
|
|
} |
9774
|
|
|
|
9775
|
|
|
// AllErrors returns a list of validation violation errors. |
9776
|
|
|
func (m TenantDeleteResponseMultiError) AllErrors() []error { return m } |
9777
|
|
|
|
9778
|
|
|
// TenantDeleteResponseValidationError is the validation error returned by |
9779
|
|
|
// TenantDeleteResponse.Validate if the designated constraints aren't met. |
9780
|
|
|
type TenantDeleteResponseValidationError struct { |
9781
|
|
|
field string |
9782
|
|
|
reason string |
9783
|
|
|
cause error |
9784
|
|
|
key bool |
9785
|
|
|
} |
9786
|
|
|
|
9787
|
|
|
// Field function returns field value. |
9788
|
|
|
func (e TenantDeleteResponseValidationError) Field() string { return e.field } |
9789
|
|
|
|
9790
|
|
|
// Reason function returns reason value. |
9791
|
|
|
func (e TenantDeleteResponseValidationError) Reason() string { return e.reason } |
9792
|
|
|
|
9793
|
|
|
// Cause function returns cause value. |
9794
|
|
|
func (e TenantDeleteResponseValidationError) Cause() error { return e.cause } |
9795
|
|
|
|
9796
|
|
|
// Key function returns key value. |
9797
|
|
|
func (e TenantDeleteResponseValidationError) Key() bool { return e.key } |
9798
|
|
|
|
9799
|
|
|
// ErrorName returns error name. |
9800
|
|
|
func (e TenantDeleteResponseValidationError) ErrorName() string { |
9801
|
|
|
return "TenantDeleteResponseValidationError" |
9802
|
|
|
} |
9803
|
|
|
|
9804
|
|
|
// Error satisfies the builtin error interface |
9805
|
|
|
func (e TenantDeleteResponseValidationError) Error() string { |
9806
|
|
|
cause := "" |
9807
|
|
|
if e.cause != nil { |
9808
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9809
|
|
|
} |
9810
|
|
|
|
9811
|
|
|
key := "" |
9812
|
|
|
if e.key { |
9813
|
|
|
key = "key for " |
9814
|
|
|
} |
9815
|
|
|
|
9816
|
|
|
return fmt.Sprintf( |
9817
|
|
|
"invalid %sTenantDeleteResponse.%s: %s%s", |
9818
|
|
|
key, |
9819
|
|
|
e.field, |
9820
|
|
|
e.reason, |
9821
|
|
|
cause) |
9822
|
|
|
} |
9823
|
|
|
|
9824
|
|
|
var _ error = TenantDeleteResponseValidationError{} |
9825
|
|
|
|
9826
|
|
|
var _ interface { |
9827
|
|
|
Field() string |
9828
|
|
|
Reason() string |
9829
|
|
|
Key() bool |
9830
|
|
|
Cause() error |
9831
|
|
|
ErrorName() string |
9832
|
|
|
} = TenantDeleteResponseValidationError{} |
9833
|
|
|
|
9834
|
|
|
// Validate checks the field values on TenantListRequest with the rules defined |
9835
|
|
|
// in the proto definition for this message. If any rules are violated, the |
9836
|
|
|
// first error encountered is returned, or nil if there are no violations. |
9837
|
|
|
func (m *TenantListRequest) Validate() error { |
9838
|
|
|
return m.validate(false) |
9839
|
|
|
} |
9840
|
|
|
|
9841
|
|
|
// ValidateAll checks the field values on TenantListRequest with the rules |
9842
|
|
|
// defined in the proto definition for this message. If any rules are |
9843
|
|
|
// violated, the result is a list of violation errors wrapped in |
9844
|
|
|
// TenantListRequestMultiError, or nil if none found. |
9845
|
|
|
func (m *TenantListRequest) ValidateAll() error { |
9846
|
|
|
return m.validate(true) |
9847
|
|
|
} |
9848
|
|
|
|
9849
|
|
|
func (m *TenantListRequest) validate(all bool) error { |
9850
|
|
|
if m == nil { |
9851
|
|
|
return nil |
9852
|
|
|
} |
9853
|
|
|
|
9854
|
|
|
var errors []error |
9855
|
|
|
|
9856
|
|
|
if m.GetPageSize() != 0 { |
9857
|
|
|
|
9858
|
|
|
if m.GetPageSize() < 1 { |
9859
|
|
|
err := TenantListRequestValidationError{ |
9860
|
|
|
field: "PageSize", |
9861
|
|
|
reason: "value must be greater than or equal to 1", |
9862
|
|
|
} |
9863
|
|
|
if !all { |
9864
|
|
|
return err |
9865
|
|
|
} |
9866
|
|
|
errors = append(errors, err) |
9867
|
|
|
} |
9868
|
|
|
|
9869
|
|
|
} |
9870
|
|
|
|
9871
|
|
|
if m.GetContinuousToken() != "" { |
9872
|
|
|
|
9873
|
|
|
} |
9874
|
|
|
|
9875
|
|
|
if len(errors) > 0 { |
9876
|
|
|
return TenantListRequestMultiError(errors) |
9877
|
|
|
} |
9878
|
|
|
|
9879
|
|
|
return nil |
9880
|
|
|
} |
9881
|
|
|
|
9882
|
|
|
// TenantListRequestMultiError is an error wrapping multiple validation errors |
9883
|
|
|
// returned by TenantListRequest.ValidateAll() if the designated constraints |
9884
|
|
|
// aren't met. |
9885
|
|
|
type TenantListRequestMultiError []error |
9886
|
|
|
|
9887
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9888
|
|
|
func (m TenantListRequestMultiError) Error() string { |
9889
|
|
|
var msgs []string |
9890
|
|
|
for _, err := range m { |
9891
|
|
|
msgs = append(msgs, err.Error()) |
9892
|
|
|
} |
9893
|
|
|
return strings.Join(msgs, "; ") |
9894
|
|
|
} |
9895
|
|
|
|
9896
|
|
|
// AllErrors returns a list of validation violation errors. |
9897
|
|
|
func (m TenantListRequestMultiError) AllErrors() []error { return m } |
9898
|
|
|
|
9899
|
|
|
// TenantListRequestValidationError is the validation error returned by |
9900
|
|
|
// TenantListRequest.Validate if the designated constraints aren't met. |
9901
|
|
|
type TenantListRequestValidationError struct { |
9902
|
|
|
field string |
9903
|
|
|
reason string |
9904
|
|
|
cause error |
9905
|
|
|
key bool |
9906
|
|
|
} |
9907
|
|
|
|
9908
|
|
|
// Field function returns field value. |
9909
|
|
|
func (e TenantListRequestValidationError) Field() string { return e.field } |
9910
|
|
|
|
9911
|
|
|
// Reason function returns reason value. |
9912
|
|
|
func (e TenantListRequestValidationError) Reason() string { return e.reason } |
9913
|
|
|
|
9914
|
|
|
// Cause function returns cause value. |
9915
|
|
|
func (e TenantListRequestValidationError) Cause() error { return e.cause } |
9916
|
|
|
|
9917
|
|
|
// Key function returns key value. |
9918
|
|
|
func (e TenantListRequestValidationError) Key() bool { return e.key } |
9919
|
|
|
|
9920
|
|
|
// ErrorName returns error name. |
9921
|
|
|
func (e TenantListRequestValidationError) ErrorName() string { |
9922
|
|
|
return "TenantListRequestValidationError" |
9923
|
|
|
} |
9924
|
|
|
|
9925
|
|
|
// Error satisfies the builtin error interface |
9926
|
|
|
func (e TenantListRequestValidationError) Error() string { |
9927
|
|
|
cause := "" |
9928
|
|
|
if e.cause != nil { |
9929
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9930
|
|
|
} |
9931
|
|
|
|
9932
|
|
|
key := "" |
9933
|
|
|
if e.key { |
9934
|
|
|
key = "key for " |
9935
|
|
|
} |
9936
|
|
|
|
9937
|
|
|
return fmt.Sprintf( |
9938
|
|
|
"invalid %sTenantListRequest.%s: %s%s", |
9939
|
|
|
key, |
9940
|
|
|
e.field, |
9941
|
|
|
e.reason, |
9942
|
|
|
cause) |
9943
|
|
|
} |
9944
|
|
|
|
9945
|
|
|
var _ error = TenantListRequestValidationError{} |
9946
|
|
|
|
9947
|
|
|
var _ interface { |
9948
|
|
|
Field() string |
9949
|
|
|
Reason() string |
9950
|
|
|
Key() bool |
9951
|
|
|
Cause() error |
9952
|
|
|
ErrorName() string |
9953
|
|
|
} = TenantListRequestValidationError{} |
9954
|
|
|
|
9955
|
|
|
// Validate checks the field values on TenantListResponse with the rules |
9956
|
|
|
// defined in the proto definition for this message. If any rules are |
9957
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9958
|
|
|
func (m *TenantListResponse) Validate() error { |
9959
|
|
|
return m.validate(false) |
9960
|
|
|
} |
9961
|
|
|
|
9962
|
|
|
// ValidateAll checks the field values on TenantListResponse with the rules |
9963
|
|
|
// defined in the proto definition for this message. If any rules are |
9964
|
|
|
// violated, the result is a list of violation errors wrapped in |
9965
|
|
|
// TenantListResponseMultiError, or nil if none found. |
9966
|
|
|
func (m *TenantListResponse) ValidateAll() error { |
9967
|
|
|
return m.validate(true) |
9968
|
|
|
} |
9969
|
|
|
|
9970
|
|
|
func (m *TenantListResponse) validate(all bool) error { |
9971
|
|
|
if m == nil { |
9972
|
|
|
return nil |
9973
|
|
|
} |
9974
|
|
|
|
9975
|
|
|
var errors []error |
9976
|
|
|
|
9977
|
|
|
for idx, item := range m.GetTenants() { |
9978
|
|
|
_, _ = idx, item |
9979
|
|
|
|
9980
|
|
|
if all { |
9981
|
|
|
switch v := interface{}(item).(type) { |
9982
|
|
|
case interface{ ValidateAll() error }: |
9983
|
|
|
if err := v.ValidateAll(); err != nil { |
9984
|
|
|
errors = append(errors, TenantListResponseValidationError{ |
9985
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9986
|
|
|
reason: "embedded message failed validation", |
9987
|
|
|
cause: err, |
9988
|
|
|
}) |
9989
|
|
|
} |
9990
|
|
|
case interface{ Validate() error }: |
9991
|
|
|
if err := v.Validate(); err != nil { |
9992
|
|
|
errors = append(errors, TenantListResponseValidationError{ |
9993
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9994
|
|
|
reason: "embedded message failed validation", |
9995
|
|
|
cause: err, |
9996
|
|
|
}) |
9997
|
|
|
} |
9998
|
|
|
} |
9999
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
10000
|
|
|
if err := v.Validate(); err != nil { |
10001
|
|
|
return TenantListResponseValidationError{ |
10002
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
10003
|
|
|
reason: "embedded message failed validation", |
10004
|
|
|
cause: err, |
10005
|
|
|
} |
10006
|
|
|
} |
10007
|
|
|
} |
10008
|
|
|
|
10009
|
|
|
} |
10010
|
|
|
|
10011
|
|
|
// no validation rules for ContinuousToken |
10012
|
|
|
|
10013
|
|
|
if len(errors) > 0 { |
10014
|
|
|
return TenantListResponseMultiError(errors) |
10015
|
|
|
} |
10016
|
|
|
|
10017
|
|
|
return nil |
10018
|
|
|
} |
10019
|
|
|
|
10020
|
|
|
// TenantListResponseMultiError is an error wrapping multiple validation errors |
10021
|
|
|
// returned by TenantListResponse.ValidateAll() if the designated constraints |
10022
|
|
|
// aren't met. |
10023
|
|
|
type TenantListResponseMultiError []error |
10024
|
|
|
|
10025
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
10026
|
|
|
func (m TenantListResponseMultiError) Error() string { |
10027
|
|
|
var msgs []string |
10028
|
|
|
for _, err := range m { |
10029
|
|
|
msgs = append(msgs, err.Error()) |
10030
|
|
|
} |
10031
|
|
|
return strings.Join(msgs, "; ") |
10032
|
|
|
} |
10033
|
|
|
|
10034
|
|
|
// AllErrors returns a list of validation violation errors. |
10035
|
|
|
func (m TenantListResponseMultiError) AllErrors() []error { return m } |
10036
|
|
|
|
10037
|
|
|
// TenantListResponseValidationError is the validation error returned by |
10038
|
|
|
// TenantListResponse.Validate if the designated constraints aren't met. |
10039
|
|
|
type TenantListResponseValidationError struct { |
10040
|
|
|
field string |
10041
|
|
|
reason string |
10042
|
|
|
cause error |
10043
|
|
|
key bool |
10044
|
|
|
} |
10045
|
|
|
|
10046
|
|
|
// Field function returns field value. |
10047
|
|
|
func (e TenantListResponseValidationError) Field() string { return e.field } |
10048
|
|
|
|
10049
|
|
|
// Reason function returns reason value. |
10050
|
|
|
func (e TenantListResponseValidationError) Reason() string { return e.reason } |
10051
|
|
|
|
10052
|
|
|
// Cause function returns cause value. |
10053
|
|
|
func (e TenantListResponseValidationError) Cause() error { return e.cause } |
10054
|
|
|
|
10055
|
|
|
// Key function returns key value. |
10056
|
|
|
func (e TenantListResponseValidationError) Key() bool { return e.key } |
10057
|
|
|
|
10058
|
|
|
// ErrorName returns error name. |
10059
|
|
|
func (e TenantListResponseValidationError) ErrorName() string { |
10060
|
|
|
return "TenantListResponseValidationError" |
10061
|
|
|
} |
10062
|
|
|
|
10063
|
|
|
// Error satisfies the builtin error interface |
10064
|
|
|
func (e TenantListResponseValidationError) Error() string { |
10065
|
|
|
cause := "" |
10066
|
|
|
if e.cause != nil { |
10067
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
10068
|
|
|
} |
10069
|
|
|
|
10070
|
|
|
key := "" |
10071
|
|
|
if e.key { |
10072
|
|
|
key = "key for " |
10073
|
|
|
} |
10074
|
|
|
|
10075
|
|
|
return fmt.Sprintf( |
10076
|
|
|
"invalid %sTenantListResponse.%s: %s%s", |
10077
|
|
|
key, |
10078
|
|
|
e.field, |
10079
|
|
|
e.reason, |
10080
|
|
|
cause) |
10081
|
|
|
} |
10082
|
|
|
|
10083
|
|
|
var _ error = TenantListResponseValidationError{} |
10084
|
|
|
|
10085
|
|
|
var _ interface { |
10086
|
|
|
Field() string |
10087
|
|
|
Reason() string |
10088
|
|
|
Key() bool |
10089
|
|
|
Cause() error |
10090
|
|
|
ErrorName() string |
10091
|
|
|
} = TenantListResponseValidationError{} |
10092
|
|
|
|