1
|
|
|
// Code generated by protoc-gen-validate. DO NOT EDIT. |
2
|
|
|
// source: base/v1/service.proto |
3
|
|
|
|
4
|
|
|
package basev1 |
5
|
|
|
|
6
|
|
|
import ( |
7
|
|
|
"bytes" |
8
|
|
|
"errors" |
9
|
|
|
"fmt" |
10
|
|
|
"net" |
11
|
|
|
"net/mail" |
12
|
|
|
"net/url" |
13
|
|
|
"regexp" |
14
|
|
|
"sort" |
15
|
|
|
"strings" |
16
|
|
|
"time" |
17
|
|
|
"unicode/utf8" |
18
|
|
|
|
19
|
|
|
"google.golang.org/protobuf/types/known/anypb" |
20
|
|
|
) |
21
|
|
|
|
22
|
|
|
// ensure the imports are used |
23
|
|
|
var ( |
24
|
|
|
_ = bytes.MinRead |
25
|
|
|
_ = errors.New("") |
26
|
|
|
_ = fmt.Print |
27
|
|
|
_ = utf8.UTFMax |
28
|
|
|
_ = (*regexp.Regexp)(nil) |
29
|
|
|
_ = (*strings.Reader)(nil) |
30
|
|
|
_ = net.IPv4len |
31
|
|
|
_ = time.Duration(0) |
32
|
|
|
_ = (*url.URL)(nil) |
33
|
|
|
_ = (*mail.Address)(nil) |
34
|
|
|
_ = anypb.Any{} |
35
|
|
|
_ = sort.Sort |
36
|
|
|
) |
37
|
|
|
|
38
|
|
|
// Validate checks the field values on PermissionCheckRequest with the rules |
39
|
|
|
// defined in the proto definition for this message. If any rules are |
40
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
41
|
|
|
func (m *PermissionCheckRequest) Validate() error { |
42
|
|
|
return m.validate(false) |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
// ValidateAll checks the field values on PermissionCheckRequest with the rules |
46
|
|
|
// defined in the proto definition for this message. If any rules are |
47
|
|
|
// violated, the result is a list of violation errors wrapped in |
48
|
|
|
// PermissionCheckRequestMultiError, or nil if none found. |
49
|
|
|
func (m *PermissionCheckRequest) ValidateAll() error { |
50
|
|
|
return m.validate(true) |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
func (m *PermissionCheckRequest) validate(all bool) error { |
54
|
|
|
if m == nil { |
55
|
|
|
return nil |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
var errors []error |
59
|
|
|
|
60
|
|
|
if len(m.GetTenantId()) > 128 { |
61
|
|
|
err := PermissionCheckRequestValidationError{ |
62
|
|
|
field: "TenantId", |
63
|
|
|
reason: "value length must be at most 128 bytes", |
64
|
|
|
} |
65
|
|
|
if !all { |
66
|
|
|
return err |
67
|
|
|
} |
68
|
|
|
errors = append(errors, err) |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
if !_PermissionCheckRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
72
|
|
|
err := PermissionCheckRequestValidationError{ |
73
|
|
|
field: "TenantId", |
74
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
75
|
|
|
} |
76
|
|
|
if !all { |
77
|
|
|
return err |
78
|
|
|
} |
79
|
|
|
errors = append(errors, err) |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
if m.GetMetadata() == nil { |
83
|
|
|
err := PermissionCheckRequestValidationError{ |
84
|
|
|
field: "Metadata", |
85
|
|
|
reason: "value is required", |
86
|
|
|
} |
87
|
|
|
if !all { |
88
|
|
|
return err |
89
|
|
|
} |
90
|
|
|
errors = append(errors, err) |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
if all { |
94
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
95
|
|
|
case interface{ ValidateAll() error }: |
96
|
|
|
if err := v.ValidateAll(); err != nil { |
97
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
98
|
|
|
field: "Metadata", |
99
|
|
|
reason: "embedded message failed validation", |
100
|
|
|
cause: err, |
101
|
|
|
}) |
102
|
|
|
} |
103
|
|
|
case interface{ Validate() error }: |
104
|
|
|
if err := v.Validate(); err != nil { |
105
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
106
|
|
|
field: "Metadata", |
107
|
|
|
reason: "embedded message failed validation", |
108
|
|
|
cause: err, |
109
|
|
|
}) |
110
|
|
|
} |
111
|
|
|
} |
112
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
113
|
|
|
if err := v.Validate(); err != nil { |
114
|
|
|
return PermissionCheckRequestValidationError{ |
115
|
|
|
field: "Metadata", |
116
|
|
|
reason: "embedded message failed validation", |
117
|
|
|
cause: err, |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
if m.GetEntity() == nil { |
123
|
|
|
err := PermissionCheckRequestValidationError{ |
124
|
|
|
field: "Entity", |
125
|
|
|
reason: "value is required", |
126
|
|
|
} |
127
|
|
|
if !all { |
128
|
|
|
return err |
129
|
|
|
} |
130
|
|
|
errors = append(errors, err) |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
if all { |
134
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
135
|
|
|
case interface{ ValidateAll() error }: |
136
|
|
|
if err := v.ValidateAll(); err != nil { |
137
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
138
|
|
|
field: "Entity", |
139
|
|
|
reason: "embedded message failed validation", |
140
|
|
|
cause: err, |
141
|
|
|
}) |
142
|
|
|
} |
143
|
|
|
case interface{ Validate() error }: |
144
|
|
|
if err := v.Validate(); err != nil { |
145
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
146
|
|
|
field: "Entity", |
147
|
|
|
reason: "embedded message failed validation", |
148
|
|
|
cause: err, |
149
|
|
|
}) |
150
|
|
|
} |
151
|
|
|
} |
152
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
153
|
|
|
if err := v.Validate(); err != nil { |
154
|
|
|
return PermissionCheckRequestValidationError{ |
155
|
|
|
field: "Entity", |
156
|
|
|
reason: "embedded message failed validation", |
157
|
|
|
cause: err, |
158
|
|
|
} |
159
|
|
|
} |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
if len(m.GetPermission()) > 64 { |
163
|
|
|
err := PermissionCheckRequestValidationError{ |
164
|
|
|
field: "Permission", |
165
|
|
|
reason: "value length must be at most 64 bytes", |
166
|
|
|
} |
167
|
|
|
if !all { |
168
|
|
|
return err |
169
|
|
|
} |
170
|
|
|
errors = append(errors, err) |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
if !_PermissionCheckRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
174
|
|
|
err := PermissionCheckRequestValidationError{ |
175
|
|
|
field: "Permission", |
176
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
177
|
|
|
} |
178
|
|
|
if !all { |
179
|
|
|
return err |
180
|
|
|
} |
181
|
|
|
errors = append(errors, err) |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
if m.GetSubject() == nil { |
185
|
|
|
err := PermissionCheckRequestValidationError{ |
186
|
|
|
field: "Subject", |
187
|
|
|
reason: "value is required", |
188
|
|
|
} |
189
|
|
|
if !all { |
190
|
|
|
return err |
191
|
|
|
} |
192
|
|
|
errors = append(errors, err) |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
if all { |
196
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
197
|
|
|
case interface{ ValidateAll() error }: |
198
|
|
|
if err := v.ValidateAll(); err != nil { |
199
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
200
|
|
|
field: "Subject", |
201
|
|
|
reason: "embedded message failed validation", |
202
|
|
|
cause: err, |
203
|
|
|
}) |
204
|
|
|
} |
205
|
|
|
case interface{ Validate() error }: |
206
|
|
|
if err := v.Validate(); err != nil { |
207
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
208
|
|
|
field: "Subject", |
209
|
|
|
reason: "embedded message failed validation", |
210
|
|
|
cause: err, |
211
|
|
|
}) |
212
|
|
|
} |
213
|
|
|
} |
214
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
215
|
|
|
if err := v.Validate(); err != nil { |
216
|
|
|
return PermissionCheckRequestValidationError{ |
217
|
|
|
field: "Subject", |
218
|
|
|
reason: "embedded message failed validation", |
219
|
|
|
cause: err, |
220
|
|
|
} |
221
|
|
|
} |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
if all { |
225
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
226
|
|
|
case interface{ ValidateAll() error }: |
227
|
|
|
if err := v.ValidateAll(); err != nil { |
228
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
229
|
|
|
field: "Context", |
230
|
|
|
reason: "embedded message failed validation", |
231
|
|
|
cause: err, |
232
|
|
|
}) |
233
|
|
|
} |
234
|
|
|
case interface{ Validate() error }: |
235
|
|
|
if err := v.Validate(); err != nil { |
236
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
237
|
|
|
field: "Context", |
238
|
|
|
reason: "embedded message failed validation", |
239
|
|
|
cause: err, |
240
|
|
|
}) |
241
|
|
|
} |
242
|
|
|
} |
243
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
244
|
|
|
if err := v.Validate(); err != nil { |
245
|
|
|
return PermissionCheckRequestValidationError{ |
246
|
|
|
field: "Context", |
247
|
|
|
reason: "embedded message failed validation", |
248
|
|
|
cause: err, |
249
|
|
|
} |
250
|
|
|
} |
251
|
|
|
} |
252
|
|
|
|
253
|
|
|
for idx, item := range m.GetArguments() { |
254
|
|
|
_, _ = idx, item |
255
|
|
|
|
256
|
|
|
if all { |
257
|
|
|
switch v := interface{}(item).(type) { |
258
|
|
|
case interface{ ValidateAll() error }: |
259
|
|
|
if err := v.ValidateAll(); err != nil { |
260
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
261
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
262
|
|
|
reason: "embedded message failed validation", |
263
|
|
|
cause: err, |
264
|
|
|
}) |
265
|
|
|
} |
266
|
|
|
case interface{ Validate() error }: |
267
|
|
|
if err := v.Validate(); err != nil { |
268
|
|
|
errors = append(errors, PermissionCheckRequestValidationError{ |
269
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
270
|
|
|
reason: "embedded message failed validation", |
271
|
|
|
cause: err, |
272
|
|
|
}) |
273
|
|
|
} |
274
|
|
|
} |
275
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
276
|
|
|
if err := v.Validate(); err != nil { |
277
|
|
|
return PermissionCheckRequestValidationError{ |
278
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
279
|
|
|
reason: "embedded message failed validation", |
280
|
|
|
cause: err, |
281
|
|
|
} |
282
|
|
|
} |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
if len(errors) > 0 { |
288
|
|
|
return PermissionCheckRequestMultiError(errors) |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
return nil |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
// PermissionCheckRequestMultiError is an error wrapping multiple validation |
295
|
|
|
// errors returned by PermissionCheckRequest.ValidateAll() if the designated |
296
|
|
|
// constraints aren't met. |
297
|
|
|
type PermissionCheckRequestMultiError []error |
298
|
|
|
|
299
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
300
|
|
|
func (m PermissionCheckRequestMultiError) Error() string { |
301
|
|
|
var msgs []string |
302
|
|
|
for _, err := range m { |
303
|
|
|
msgs = append(msgs, err.Error()) |
304
|
|
|
} |
305
|
|
|
return strings.Join(msgs, "; ") |
306
|
|
|
} |
307
|
|
|
|
308
|
|
|
// AllErrors returns a list of validation violation errors. |
309
|
|
|
func (m PermissionCheckRequestMultiError) AllErrors() []error { return m } |
310
|
|
|
|
311
|
|
|
// PermissionCheckRequestValidationError is the validation error returned by |
312
|
|
|
// PermissionCheckRequest.Validate if the designated constraints aren't met. |
313
|
|
|
type PermissionCheckRequestValidationError struct { |
314
|
|
|
field string |
315
|
|
|
reason string |
316
|
|
|
cause error |
317
|
|
|
key bool |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
// Field function returns field value. |
321
|
|
|
func (e PermissionCheckRequestValidationError) Field() string { return e.field } |
322
|
|
|
|
323
|
|
|
// Reason function returns reason value. |
324
|
|
|
func (e PermissionCheckRequestValidationError) Reason() string { return e.reason } |
325
|
|
|
|
326
|
|
|
// Cause function returns cause value. |
327
|
|
|
func (e PermissionCheckRequestValidationError) Cause() error { return e.cause } |
328
|
|
|
|
329
|
|
|
// Key function returns key value. |
330
|
|
|
func (e PermissionCheckRequestValidationError) Key() bool { return e.key } |
331
|
|
|
|
332
|
|
|
// ErrorName returns error name. |
333
|
|
|
func (e PermissionCheckRequestValidationError) ErrorName() string { |
334
|
|
|
return "PermissionCheckRequestValidationError" |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
// Error satisfies the builtin error interface |
338
|
|
|
func (e PermissionCheckRequestValidationError) Error() string { |
339
|
|
|
cause := "" |
340
|
|
|
if e.cause != nil { |
341
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
key := "" |
345
|
|
|
if e.key { |
346
|
|
|
key = "key for " |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
return fmt.Sprintf( |
350
|
|
|
"invalid %sPermissionCheckRequest.%s: %s%s", |
351
|
|
|
key, |
352
|
|
|
e.field, |
353
|
|
|
e.reason, |
354
|
|
|
cause) |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
var _ error = PermissionCheckRequestValidationError{} |
358
|
|
|
|
359
|
|
|
var _ interface { |
360
|
|
|
Field() string |
361
|
|
|
Reason() string |
362
|
|
|
Key() bool |
363
|
|
|
Cause() error |
364
|
|
|
ErrorName() string |
365
|
|
|
} = PermissionCheckRequestValidationError{} |
366
|
|
|
|
367
|
|
|
var _PermissionCheckRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
368
|
|
|
|
369
|
|
|
var _PermissionCheckRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
370
|
|
|
|
371
|
|
|
// Validate checks the field values on PermissionCheckRequestMetadata with the |
372
|
|
|
// rules defined in the proto definition for this message. If any rules are |
373
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
374
|
|
|
func (m *PermissionCheckRequestMetadata) Validate() error { |
375
|
|
|
return m.validate(false) |
376
|
|
|
} |
377
|
|
|
|
378
|
|
|
// ValidateAll checks the field values on PermissionCheckRequestMetadata with |
379
|
|
|
// the rules defined in the proto definition for this message. If any rules |
380
|
|
|
// are violated, the result is a list of violation errors wrapped in |
381
|
|
|
// PermissionCheckRequestMetadataMultiError, or nil if none found. |
382
|
|
|
func (m *PermissionCheckRequestMetadata) ValidateAll() error { |
383
|
|
|
return m.validate(true) |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
func (m *PermissionCheckRequestMetadata) validate(all bool) error { |
387
|
|
|
if m == nil { |
388
|
|
|
return nil |
389
|
|
|
} |
390
|
|
|
|
391
|
|
|
var errors []error |
392
|
|
|
|
393
|
|
|
// no validation rules for SchemaVersion |
394
|
|
|
|
395
|
|
|
// no validation rules for SnapToken |
396
|
|
|
|
397
|
|
|
if m.GetDepth() < 3 { |
398
|
|
|
err := PermissionCheckRequestMetadataValidationError{ |
399
|
|
|
field: "Depth", |
400
|
|
|
reason: "value must be greater than or equal to 3", |
401
|
|
|
} |
402
|
|
|
if !all { |
403
|
|
|
return err |
404
|
|
|
} |
405
|
|
|
errors = append(errors, err) |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
if len(errors) > 0 { |
409
|
|
|
return PermissionCheckRequestMetadataMultiError(errors) |
410
|
|
|
} |
411
|
|
|
|
412
|
|
|
return nil |
413
|
|
|
} |
414
|
|
|
|
415
|
|
|
// PermissionCheckRequestMetadataMultiError is an error wrapping multiple |
416
|
|
|
// validation errors returned by PermissionCheckRequestMetadata.ValidateAll() |
417
|
|
|
// if the designated constraints aren't met. |
418
|
|
|
type PermissionCheckRequestMetadataMultiError []error |
419
|
|
|
|
420
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
421
|
|
|
func (m PermissionCheckRequestMetadataMultiError) Error() string { |
422
|
|
|
var msgs []string |
423
|
|
|
for _, err := range m { |
424
|
|
|
msgs = append(msgs, err.Error()) |
425
|
|
|
} |
426
|
|
|
return strings.Join(msgs, "; ") |
427
|
|
|
} |
428
|
|
|
|
429
|
|
|
// AllErrors returns a list of validation violation errors. |
430
|
|
|
func (m PermissionCheckRequestMetadataMultiError) AllErrors() []error { return m } |
431
|
|
|
|
432
|
|
|
// PermissionCheckRequestMetadataValidationError is the validation error |
433
|
|
|
// returned by PermissionCheckRequestMetadata.Validate if the designated |
434
|
|
|
// constraints aren't met. |
435
|
|
|
type PermissionCheckRequestMetadataValidationError struct { |
436
|
|
|
field string |
437
|
|
|
reason string |
438
|
|
|
cause error |
439
|
|
|
key bool |
440
|
|
|
} |
441
|
|
|
|
442
|
|
|
// Field function returns field value. |
443
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Field() string { return e.field } |
444
|
|
|
|
445
|
|
|
// Reason function returns reason value. |
446
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Reason() string { return e.reason } |
447
|
|
|
|
448
|
|
|
// Cause function returns cause value. |
449
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Cause() error { return e.cause } |
450
|
|
|
|
451
|
|
|
// Key function returns key value. |
452
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Key() bool { return e.key } |
453
|
|
|
|
454
|
|
|
// ErrorName returns error name. |
455
|
|
|
func (e PermissionCheckRequestMetadataValidationError) ErrorName() string { |
456
|
|
|
return "PermissionCheckRequestMetadataValidationError" |
457
|
|
|
} |
458
|
|
|
|
459
|
|
|
// Error satisfies the builtin error interface |
460
|
|
|
func (e PermissionCheckRequestMetadataValidationError) Error() string { |
461
|
|
|
cause := "" |
462
|
|
|
if e.cause != nil { |
463
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
key := "" |
467
|
|
|
if e.key { |
468
|
|
|
key = "key for " |
469
|
|
|
} |
470
|
|
|
|
471
|
|
|
return fmt.Sprintf( |
472
|
|
|
"invalid %sPermissionCheckRequestMetadata.%s: %s%s", |
473
|
|
|
key, |
474
|
|
|
e.field, |
475
|
|
|
e.reason, |
476
|
|
|
cause) |
477
|
|
|
} |
478
|
|
|
|
479
|
|
|
var _ error = PermissionCheckRequestMetadataValidationError{} |
480
|
|
|
|
481
|
|
|
var _ interface { |
482
|
|
|
Field() string |
483
|
|
|
Reason() string |
484
|
|
|
Key() bool |
485
|
|
|
Cause() error |
486
|
|
|
ErrorName() string |
487
|
|
|
} = PermissionCheckRequestMetadataValidationError{} |
488
|
|
|
|
489
|
|
|
// Validate checks the field values on PermissionCheckResponse with the rules |
490
|
|
|
// defined in the proto definition for this message. If any rules are |
491
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
492
|
|
|
func (m *PermissionCheckResponse) Validate() error { |
493
|
|
|
return m.validate(false) |
494
|
|
|
} |
495
|
|
|
|
496
|
|
|
// ValidateAll checks the field values on PermissionCheckResponse with the |
497
|
|
|
// rules defined in the proto definition for this message. If any rules are |
498
|
|
|
// violated, the result is a list of violation errors wrapped in |
499
|
|
|
// PermissionCheckResponseMultiError, or nil if none found. |
500
|
|
|
func (m *PermissionCheckResponse) ValidateAll() error { |
501
|
|
|
return m.validate(true) |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
func (m *PermissionCheckResponse) validate(all bool) error { |
505
|
|
|
if m == nil { |
506
|
|
|
return nil |
507
|
|
|
} |
508
|
|
|
|
509
|
|
|
var errors []error |
510
|
|
|
|
511
|
|
|
// no validation rules for Can |
512
|
|
|
|
513
|
|
|
if all { |
514
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
515
|
|
|
case interface{ ValidateAll() error }: |
516
|
|
|
if err := v.ValidateAll(); err != nil { |
517
|
|
|
errors = append(errors, PermissionCheckResponseValidationError{ |
518
|
|
|
field: "Metadata", |
519
|
|
|
reason: "embedded message failed validation", |
520
|
|
|
cause: err, |
521
|
|
|
}) |
522
|
|
|
} |
523
|
|
|
case interface{ Validate() error }: |
524
|
|
|
if err := v.Validate(); err != nil { |
525
|
|
|
errors = append(errors, PermissionCheckResponseValidationError{ |
526
|
|
|
field: "Metadata", |
527
|
|
|
reason: "embedded message failed validation", |
528
|
|
|
cause: err, |
529
|
|
|
}) |
530
|
|
|
} |
531
|
|
|
} |
532
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
533
|
|
|
if err := v.Validate(); err != nil { |
534
|
|
|
return PermissionCheckResponseValidationError{ |
535
|
|
|
field: "Metadata", |
536
|
|
|
reason: "embedded message failed validation", |
537
|
|
|
cause: err, |
538
|
|
|
} |
539
|
|
|
} |
540
|
|
|
} |
541
|
|
|
|
542
|
|
|
if len(errors) > 0 { |
543
|
|
|
return PermissionCheckResponseMultiError(errors) |
544
|
|
|
} |
545
|
|
|
|
546
|
|
|
return nil |
547
|
|
|
} |
548
|
|
|
|
549
|
|
|
// PermissionCheckResponseMultiError is an error wrapping multiple validation |
550
|
|
|
// errors returned by PermissionCheckResponse.ValidateAll() if the designated |
551
|
|
|
// constraints aren't met. |
552
|
|
|
type PermissionCheckResponseMultiError []error |
553
|
|
|
|
554
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
555
|
|
|
func (m PermissionCheckResponseMultiError) Error() string { |
556
|
|
|
var msgs []string |
557
|
|
|
for _, err := range m { |
558
|
|
|
msgs = append(msgs, err.Error()) |
559
|
|
|
} |
560
|
|
|
return strings.Join(msgs, "; ") |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
// AllErrors returns a list of validation violation errors. |
564
|
|
|
func (m PermissionCheckResponseMultiError) AllErrors() []error { return m } |
565
|
|
|
|
566
|
|
|
// PermissionCheckResponseValidationError is the validation error returned by |
567
|
|
|
// PermissionCheckResponse.Validate if the designated constraints aren't met. |
568
|
|
|
type PermissionCheckResponseValidationError struct { |
569
|
|
|
field string |
570
|
|
|
reason string |
571
|
|
|
cause error |
572
|
|
|
key bool |
573
|
|
|
} |
574
|
|
|
|
575
|
|
|
// Field function returns field value. |
576
|
|
|
func (e PermissionCheckResponseValidationError) Field() string { return e.field } |
577
|
|
|
|
578
|
|
|
// Reason function returns reason value. |
579
|
|
|
func (e PermissionCheckResponseValidationError) Reason() string { return e.reason } |
580
|
|
|
|
581
|
|
|
// Cause function returns cause value. |
582
|
|
|
func (e PermissionCheckResponseValidationError) Cause() error { return e.cause } |
583
|
|
|
|
584
|
|
|
// Key function returns key value. |
585
|
|
|
func (e PermissionCheckResponseValidationError) Key() bool { return e.key } |
586
|
|
|
|
587
|
|
|
// ErrorName returns error name. |
588
|
|
|
func (e PermissionCheckResponseValidationError) ErrorName() string { |
589
|
|
|
return "PermissionCheckResponseValidationError" |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
// Error satisfies the builtin error interface |
593
|
|
|
func (e PermissionCheckResponseValidationError) Error() string { |
594
|
|
|
cause := "" |
595
|
|
|
if e.cause != nil { |
596
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
597
|
|
|
} |
598
|
|
|
|
599
|
|
|
key := "" |
600
|
|
|
if e.key { |
601
|
|
|
key = "key for " |
602
|
|
|
} |
603
|
|
|
|
604
|
|
|
return fmt.Sprintf( |
605
|
|
|
"invalid %sPermissionCheckResponse.%s: %s%s", |
606
|
|
|
key, |
607
|
|
|
e.field, |
608
|
|
|
e.reason, |
609
|
|
|
cause) |
610
|
|
|
} |
611
|
|
|
|
612
|
|
|
var _ error = PermissionCheckResponseValidationError{} |
613
|
|
|
|
614
|
|
|
var _ interface { |
615
|
|
|
Field() string |
616
|
|
|
Reason() string |
617
|
|
|
Key() bool |
618
|
|
|
Cause() error |
619
|
|
|
ErrorName() string |
620
|
|
|
} = PermissionCheckResponseValidationError{} |
621
|
|
|
|
622
|
|
|
// Validate checks the field values on PermissionCheckResponseMetadata with the |
623
|
|
|
// rules defined in the proto definition for this message. If any rules are |
624
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
625
|
|
|
func (m *PermissionCheckResponseMetadata) Validate() error { |
626
|
|
|
return m.validate(false) |
627
|
|
|
} |
628
|
|
|
|
629
|
|
|
// ValidateAll checks the field values on PermissionCheckResponseMetadata with |
630
|
|
|
// the rules defined in the proto definition for this message. If any rules |
631
|
|
|
// are violated, the result is a list of violation errors wrapped in |
632
|
|
|
// PermissionCheckResponseMetadataMultiError, or nil if none found. |
633
|
|
|
func (m *PermissionCheckResponseMetadata) ValidateAll() error { |
634
|
|
|
return m.validate(true) |
635
|
|
|
} |
636
|
|
|
|
637
|
|
|
func (m *PermissionCheckResponseMetadata) validate(all bool) error { |
638
|
|
|
if m == nil { |
639
|
|
|
return nil |
640
|
|
|
} |
641
|
|
|
|
642
|
|
|
var errors []error |
643
|
|
|
|
644
|
|
|
// no validation rules for CheckCount |
645
|
|
|
|
646
|
|
|
if len(errors) > 0 { |
647
|
|
|
return PermissionCheckResponseMetadataMultiError(errors) |
648
|
|
|
} |
649
|
|
|
|
650
|
|
|
return nil |
651
|
|
|
} |
652
|
|
|
|
653
|
|
|
// PermissionCheckResponseMetadataMultiError is an error wrapping multiple |
654
|
|
|
// validation errors returned by PermissionCheckResponseMetadata.ValidateAll() |
655
|
|
|
// if the designated constraints aren't met. |
656
|
|
|
type PermissionCheckResponseMetadataMultiError []error |
657
|
|
|
|
658
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
659
|
|
|
func (m PermissionCheckResponseMetadataMultiError) Error() string { |
660
|
|
|
var msgs []string |
661
|
|
|
for _, err := range m { |
662
|
|
|
msgs = append(msgs, err.Error()) |
663
|
|
|
} |
664
|
|
|
return strings.Join(msgs, "; ") |
665
|
|
|
} |
666
|
|
|
|
667
|
|
|
// AllErrors returns a list of validation violation errors. |
668
|
|
|
func (m PermissionCheckResponseMetadataMultiError) AllErrors() []error { return m } |
669
|
|
|
|
670
|
|
|
// PermissionCheckResponseMetadataValidationError is the validation error |
671
|
|
|
// returned by PermissionCheckResponseMetadata.Validate if the designated |
672
|
|
|
// constraints aren't met. |
673
|
|
|
type PermissionCheckResponseMetadataValidationError struct { |
674
|
|
|
field string |
675
|
|
|
reason string |
676
|
|
|
cause error |
677
|
|
|
key bool |
678
|
|
|
} |
679
|
|
|
|
680
|
|
|
// Field function returns field value. |
681
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Field() string { return e.field } |
682
|
|
|
|
683
|
|
|
// Reason function returns reason value. |
684
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Reason() string { return e.reason } |
685
|
|
|
|
686
|
|
|
// Cause function returns cause value. |
687
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Cause() error { return e.cause } |
688
|
|
|
|
689
|
|
|
// Key function returns key value. |
690
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Key() bool { return e.key } |
691
|
|
|
|
692
|
|
|
// ErrorName returns error name. |
693
|
|
|
func (e PermissionCheckResponseMetadataValidationError) ErrorName() string { |
694
|
|
|
return "PermissionCheckResponseMetadataValidationError" |
695
|
|
|
} |
696
|
|
|
|
697
|
|
|
// Error satisfies the builtin error interface |
698
|
|
|
func (e PermissionCheckResponseMetadataValidationError) Error() string { |
699
|
|
|
cause := "" |
700
|
|
|
if e.cause != nil { |
701
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
702
|
|
|
} |
703
|
|
|
|
704
|
|
|
key := "" |
705
|
|
|
if e.key { |
706
|
|
|
key = "key for " |
707
|
|
|
} |
708
|
|
|
|
709
|
|
|
return fmt.Sprintf( |
710
|
|
|
"invalid %sPermissionCheckResponseMetadata.%s: %s%s", |
711
|
|
|
key, |
712
|
|
|
e.field, |
713
|
|
|
e.reason, |
714
|
|
|
cause) |
715
|
|
|
} |
716
|
|
|
|
717
|
|
|
var _ error = PermissionCheckResponseMetadataValidationError{} |
718
|
|
|
|
719
|
|
|
var _ interface { |
720
|
|
|
Field() string |
721
|
|
|
Reason() string |
722
|
|
|
Key() bool |
723
|
|
|
Cause() error |
724
|
|
|
ErrorName() string |
725
|
|
|
} = PermissionCheckResponseMetadataValidationError{} |
726
|
|
|
|
727
|
|
|
// Validate checks the field values on PermissionExpandRequest with the rules |
728
|
|
|
// defined in the proto definition for this message. If any rules are |
729
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
730
|
|
|
func (m *PermissionExpandRequest) Validate() error { |
731
|
|
|
return m.validate(false) |
732
|
|
|
} |
733
|
|
|
|
734
|
|
|
// ValidateAll checks the field values on PermissionExpandRequest with the |
735
|
|
|
// rules defined in the proto definition for this message. If any rules are |
736
|
|
|
// violated, the result is a list of violation errors wrapped in |
737
|
|
|
// PermissionExpandRequestMultiError, or nil if none found. |
738
|
|
|
func (m *PermissionExpandRequest) ValidateAll() error { |
739
|
|
|
return m.validate(true) |
740
|
|
|
} |
741
|
|
|
|
742
|
|
|
func (m *PermissionExpandRequest) validate(all bool) error { |
743
|
|
|
if m == nil { |
744
|
|
|
return nil |
745
|
|
|
} |
746
|
|
|
|
747
|
|
|
var errors []error |
748
|
|
|
|
749
|
|
|
if len(m.GetTenantId()) > 128 { |
750
|
|
|
err := PermissionExpandRequestValidationError{ |
751
|
|
|
field: "TenantId", |
752
|
|
|
reason: "value length must be at most 128 bytes", |
753
|
|
|
} |
754
|
|
|
if !all { |
755
|
|
|
return err |
756
|
|
|
} |
757
|
|
|
errors = append(errors, err) |
758
|
|
|
} |
759
|
|
|
|
760
|
|
|
if !_PermissionExpandRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
761
|
|
|
err := PermissionExpandRequestValidationError{ |
762
|
|
|
field: "TenantId", |
763
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
764
|
|
|
} |
765
|
|
|
if !all { |
766
|
|
|
return err |
767
|
|
|
} |
768
|
|
|
errors = append(errors, err) |
769
|
|
|
} |
770
|
|
|
|
771
|
|
|
if m.GetMetadata() == nil { |
772
|
|
|
err := PermissionExpandRequestValidationError{ |
773
|
|
|
field: "Metadata", |
774
|
|
|
reason: "value is required", |
775
|
|
|
} |
776
|
|
|
if !all { |
777
|
|
|
return err |
778
|
|
|
} |
779
|
|
|
errors = append(errors, err) |
780
|
|
|
} |
781
|
|
|
|
782
|
|
|
if all { |
783
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
784
|
|
|
case interface{ ValidateAll() error }: |
785
|
|
|
if err := v.ValidateAll(); err != nil { |
786
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
787
|
|
|
field: "Metadata", |
788
|
|
|
reason: "embedded message failed validation", |
789
|
|
|
cause: err, |
790
|
|
|
}) |
791
|
|
|
} |
792
|
|
|
case interface{ Validate() error }: |
793
|
|
|
if err := v.Validate(); err != nil { |
794
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
795
|
|
|
field: "Metadata", |
796
|
|
|
reason: "embedded message failed validation", |
797
|
|
|
cause: err, |
798
|
|
|
}) |
799
|
|
|
} |
800
|
|
|
} |
801
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
802
|
|
|
if err := v.Validate(); err != nil { |
803
|
|
|
return PermissionExpandRequestValidationError{ |
804
|
|
|
field: "Metadata", |
805
|
|
|
reason: "embedded message failed validation", |
806
|
|
|
cause: err, |
807
|
|
|
} |
808
|
|
|
} |
809
|
|
|
} |
810
|
|
|
|
811
|
|
|
if m.GetEntity() == nil { |
812
|
|
|
err := PermissionExpandRequestValidationError{ |
813
|
|
|
field: "Entity", |
814
|
|
|
reason: "value is required", |
815
|
|
|
} |
816
|
|
|
if !all { |
817
|
|
|
return err |
818
|
|
|
} |
819
|
|
|
errors = append(errors, err) |
820
|
|
|
} |
821
|
|
|
|
822
|
|
|
if all { |
823
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
824
|
|
|
case interface{ ValidateAll() error }: |
825
|
|
|
if err := v.ValidateAll(); err != nil { |
826
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
827
|
|
|
field: "Entity", |
828
|
|
|
reason: "embedded message failed validation", |
829
|
|
|
cause: err, |
830
|
|
|
}) |
831
|
|
|
} |
832
|
|
|
case interface{ Validate() error }: |
833
|
|
|
if err := v.Validate(); err != nil { |
834
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
835
|
|
|
field: "Entity", |
836
|
|
|
reason: "embedded message failed validation", |
837
|
|
|
cause: err, |
838
|
|
|
}) |
839
|
|
|
} |
840
|
|
|
} |
841
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
842
|
|
|
if err := v.Validate(); err != nil { |
843
|
|
|
return PermissionExpandRequestValidationError{ |
844
|
|
|
field: "Entity", |
845
|
|
|
reason: "embedded message failed validation", |
846
|
|
|
cause: err, |
847
|
|
|
} |
848
|
|
|
} |
849
|
|
|
} |
850
|
|
|
|
851
|
|
|
if m.GetPermission() != "" { |
852
|
|
|
|
853
|
|
|
if len(m.GetPermission()) > 64 { |
854
|
|
|
err := PermissionExpandRequestValidationError{ |
855
|
|
|
field: "Permission", |
856
|
|
|
reason: "value length must be at most 64 bytes", |
857
|
|
|
} |
858
|
|
|
if !all { |
859
|
|
|
return err |
860
|
|
|
} |
861
|
|
|
errors = append(errors, err) |
862
|
|
|
} |
863
|
|
|
|
864
|
|
|
if !_PermissionExpandRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
865
|
|
|
err := PermissionExpandRequestValidationError{ |
866
|
|
|
field: "Permission", |
867
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
868
|
|
|
} |
869
|
|
|
if !all { |
870
|
|
|
return err |
871
|
|
|
} |
872
|
|
|
errors = append(errors, err) |
873
|
|
|
} |
874
|
|
|
|
875
|
|
|
} |
876
|
|
|
|
877
|
|
|
if all { |
878
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
879
|
|
|
case interface{ ValidateAll() error }: |
880
|
|
|
if err := v.ValidateAll(); err != nil { |
881
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
882
|
|
|
field: "Context", |
883
|
|
|
reason: "embedded message failed validation", |
884
|
|
|
cause: err, |
885
|
|
|
}) |
886
|
|
|
} |
887
|
|
|
case interface{ Validate() error }: |
888
|
|
|
if err := v.Validate(); err != nil { |
889
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
890
|
|
|
field: "Context", |
891
|
|
|
reason: "embedded message failed validation", |
892
|
|
|
cause: err, |
893
|
|
|
}) |
894
|
|
|
} |
895
|
|
|
} |
896
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
897
|
|
|
if err := v.Validate(); err != nil { |
898
|
|
|
return PermissionExpandRequestValidationError{ |
899
|
|
|
field: "Context", |
900
|
|
|
reason: "embedded message failed validation", |
901
|
|
|
cause: err, |
902
|
|
|
} |
903
|
|
|
} |
904
|
|
|
} |
905
|
|
|
|
906
|
|
|
for idx, item := range m.GetArguments() { |
907
|
|
|
_, _ = idx, item |
908
|
|
|
|
909
|
|
|
if all { |
910
|
|
|
switch v := interface{}(item).(type) { |
911
|
|
|
case interface{ ValidateAll() error }: |
912
|
|
|
if err := v.ValidateAll(); err != nil { |
913
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
914
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
915
|
|
|
reason: "embedded message failed validation", |
916
|
|
|
cause: err, |
917
|
|
|
}) |
918
|
|
|
} |
919
|
|
|
case interface{ Validate() error }: |
920
|
|
|
if err := v.Validate(); err != nil { |
921
|
|
|
errors = append(errors, PermissionExpandRequestValidationError{ |
922
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
923
|
|
|
reason: "embedded message failed validation", |
924
|
|
|
cause: err, |
925
|
|
|
}) |
926
|
|
|
} |
927
|
|
|
} |
928
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
929
|
|
|
if err := v.Validate(); err != nil { |
930
|
|
|
return PermissionExpandRequestValidationError{ |
931
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
932
|
|
|
reason: "embedded message failed validation", |
933
|
|
|
cause: err, |
934
|
|
|
} |
935
|
|
|
} |
936
|
|
|
} |
937
|
|
|
|
938
|
|
|
} |
939
|
|
|
|
940
|
|
|
if len(errors) > 0 { |
941
|
|
|
return PermissionExpandRequestMultiError(errors) |
942
|
|
|
} |
943
|
|
|
|
944
|
|
|
return nil |
945
|
|
|
} |
946
|
|
|
|
947
|
|
|
// PermissionExpandRequestMultiError is an error wrapping multiple validation |
948
|
|
|
// errors returned by PermissionExpandRequest.ValidateAll() if the designated |
949
|
|
|
// constraints aren't met. |
950
|
|
|
type PermissionExpandRequestMultiError []error |
951
|
|
|
|
952
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
953
|
|
|
func (m PermissionExpandRequestMultiError) Error() string { |
954
|
|
|
var msgs []string |
955
|
|
|
for _, err := range m { |
956
|
|
|
msgs = append(msgs, err.Error()) |
957
|
|
|
} |
958
|
|
|
return strings.Join(msgs, "; ") |
959
|
|
|
} |
960
|
|
|
|
961
|
|
|
// AllErrors returns a list of validation violation errors. |
962
|
|
|
func (m PermissionExpandRequestMultiError) AllErrors() []error { return m } |
963
|
|
|
|
964
|
|
|
// PermissionExpandRequestValidationError is the validation error returned by |
965
|
|
|
// PermissionExpandRequest.Validate if the designated constraints aren't met. |
966
|
|
|
type PermissionExpandRequestValidationError struct { |
967
|
|
|
field string |
968
|
|
|
reason string |
969
|
|
|
cause error |
970
|
|
|
key bool |
971
|
|
|
} |
972
|
|
|
|
973
|
|
|
// Field function returns field value. |
974
|
|
|
func (e PermissionExpandRequestValidationError) Field() string { return e.field } |
975
|
|
|
|
976
|
|
|
// Reason function returns reason value. |
977
|
|
|
func (e PermissionExpandRequestValidationError) Reason() string { return e.reason } |
978
|
|
|
|
979
|
|
|
// Cause function returns cause value. |
980
|
|
|
func (e PermissionExpandRequestValidationError) Cause() error { return e.cause } |
981
|
|
|
|
982
|
|
|
// Key function returns key value. |
983
|
|
|
func (e PermissionExpandRequestValidationError) Key() bool { return e.key } |
984
|
|
|
|
985
|
|
|
// ErrorName returns error name. |
986
|
|
|
func (e PermissionExpandRequestValidationError) ErrorName() string { |
987
|
|
|
return "PermissionExpandRequestValidationError" |
988
|
|
|
} |
989
|
|
|
|
990
|
|
|
// Error satisfies the builtin error interface |
991
|
|
|
func (e PermissionExpandRequestValidationError) Error() string { |
992
|
|
|
cause := "" |
993
|
|
|
if e.cause != nil { |
994
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
995
|
|
|
} |
996
|
|
|
|
997
|
|
|
key := "" |
998
|
|
|
if e.key { |
999
|
|
|
key = "key for " |
1000
|
|
|
} |
1001
|
|
|
|
1002
|
|
|
return fmt.Sprintf( |
1003
|
|
|
"invalid %sPermissionExpandRequest.%s: %s%s", |
1004
|
|
|
key, |
1005
|
|
|
e.field, |
1006
|
|
|
e.reason, |
1007
|
|
|
cause) |
1008
|
|
|
} |
1009
|
|
|
|
1010
|
|
|
var _ error = PermissionExpandRequestValidationError{} |
1011
|
|
|
|
1012
|
|
|
var _ interface { |
1013
|
|
|
Field() string |
1014
|
|
|
Reason() string |
1015
|
|
|
Key() bool |
1016
|
|
|
Cause() error |
1017
|
|
|
ErrorName() string |
1018
|
|
|
} = PermissionExpandRequestValidationError{} |
1019
|
|
|
|
1020
|
|
|
var _PermissionExpandRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
1021
|
|
|
|
1022
|
|
|
var _PermissionExpandRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1023
|
|
|
|
1024
|
|
|
// Validate checks the field values on PermissionExpandRequestMetadata with the |
1025
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1026
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1027
|
|
|
func (m *PermissionExpandRequestMetadata) Validate() error { |
1028
|
|
|
return m.validate(false) |
1029
|
|
|
} |
1030
|
|
|
|
1031
|
|
|
// ValidateAll checks the field values on PermissionExpandRequestMetadata with |
1032
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1033
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1034
|
|
|
// PermissionExpandRequestMetadataMultiError, or nil if none found. |
1035
|
|
|
func (m *PermissionExpandRequestMetadata) ValidateAll() error { |
1036
|
|
|
return m.validate(true) |
1037
|
|
|
} |
1038
|
|
|
|
1039
|
|
|
func (m *PermissionExpandRequestMetadata) validate(all bool) error { |
1040
|
|
|
if m == nil { |
1041
|
|
|
return nil |
1042
|
|
|
} |
1043
|
|
|
|
1044
|
|
|
var errors []error |
1045
|
|
|
|
1046
|
|
|
// no validation rules for SchemaVersion |
1047
|
|
|
|
1048
|
|
|
// no validation rules for SnapToken |
1049
|
|
|
|
1050
|
|
|
if len(errors) > 0 { |
1051
|
|
|
return PermissionExpandRequestMetadataMultiError(errors) |
1052
|
|
|
} |
1053
|
|
|
|
1054
|
|
|
return nil |
1055
|
|
|
} |
1056
|
|
|
|
1057
|
|
|
// PermissionExpandRequestMetadataMultiError is an error wrapping multiple |
1058
|
|
|
// validation errors returned by PermissionExpandRequestMetadata.ValidateAll() |
1059
|
|
|
// if the designated constraints aren't met. |
1060
|
|
|
type PermissionExpandRequestMetadataMultiError []error |
1061
|
|
|
|
1062
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1063
|
|
|
func (m PermissionExpandRequestMetadataMultiError) Error() string { |
1064
|
|
|
var msgs []string |
1065
|
|
|
for _, err := range m { |
1066
|
|
|
msgs = append(msgs, err.Error()) |
1067
|
|
|
} |
1068
|
|
|
return strings.Join(msgs, "; ") |
1069
|
|
|
} |
1070
|
|
|
|
1071
|
|
|
// AllErrors returns a list of validation violation errors. |
1072
|
|
|
func (m PermissionExpandRequestMetadataMultiError) AllErrors() []error { return m } |
1073
|
|
|
|
1074
|
|
|
// PermissionExpandRequestMetadataValidationError is the validation error |
1075
|
|
|
// returned by PermissionExpandRequestMetadata.Validate if the designated |
1076
|
|
|
// constraints aren't met. |
1077
|
|
|
type PermissionExpandRequestMetadataValidationError struct { |
1078
|
|
|
field string |
1079
|
|
|
reason string |
1080
|
|
|
cause error |
1081
|
|
|
key bool |
1082
|
|
|
} |
1083
|
|
|
|
1084
|
|
|
// Field function returns field value. |
1085
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Field() string { return e.field } |
1086
|
|
|
|
1087
|
|
|
// Reason function returns reason value. |
1088
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Reason() string { return e.reason } |
1089
|
|
|
|
1090
|
|
|
// Cause function returns cause value. |
1091
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Cause() error { return e.cause } |
1092
|
|
|
|
1093
|
|
|
// Key function returns key value. |
1094
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Key() bool { return e.key } |
1095
|
|
|
|
1096
|
|
|
// ErrorName returns error name. |
1097
|
|
|
func (e PermissionExpandRequestMetadataValidationError) ErrorName() string { |
1098
|
|
|
return "PermissionExpandRequestMetadataValidationError" |
1099
|
|
|
} |
1100
|
|
|
|
1101
|
|
|
// Error satisfies the builtin error interface |
1102
|
|
|
func (e PermissionExpandRequestMetadataValidationError) Error() string { |
1103
|
|
|
cause := "" |
1104
|
|
|
if e.cause != nil { |
1105
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1106
|
|
|
} |
1107
|
|
|
|
1108
|
|
|
key := "" |
1109
|
|
|
if e.key { |
1110
|
|
|
key = "key for " |
1111
|
|
|
} |
1112
|
|
|
|
1113
|
|
|
return fmt.Sprintf( |
1114
|
|
|
"invalid %sPermissionExpandRequestMetadata.%s: %s%s", |
1115
|
|
|
key, |
1116
|
|
|
e.field, |
1117
|
|
|
e.reason, |
1118
|
|
|
cause) |
1119
|
|
|
} |
1120
|
|
|
|
1121
|
|
|
var _ error = PermissionExpandRequestMetadataValidationError{} |
1122
|
|
|
|
1123
|
|
|
var _ interface { |
1124
|
|
|
Field() string |
1125
|
|
|
Reason() string |
1126
|
|
|
Key() bool |
1127
|
|
|
Cause() error |
1128
|
|
|
ErrorName() string |
1129
|
|
|
} = PermissionExpandRequestMetadataValidationError{} |
1130
|
|
|
|
1131
|
|
|
// Validate checks the field values on PermissionExpandResponse with the rules |
1132
|
|
|
// defined in the proto definition for this message. If any rules are |
1133
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1134
|
|
|
func (m *PermissionExpandResponse) Validate() error { |
1135
|
|
|
return m.validate(false) |
1136
|
|
|
} |
1137
|
|
|
|
1138
|
|
|
// ValidateAll checks the field values on PermissionExpandResponse with the |
1139
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1140
|
|
|
// violated, the result is a list of violation errors wrapped in |
1141
|
|
|
// PermissionExpandResponseMultiError, or nil if none found. |
1142
|
|
|
func (m *PermissionExpandResponse) ValidateAll() error { |
1143
|
|
|
return m.validate(true) |
1144
|
|
|
} |
1145
|
|
|
|
1146
|
|
|
func (m *PermissionExpandResponse) validate(all bool) error { |
1147
|
|
|
if m == nil { |
1148
|
|
|
return nil |
1149
|
|
|
} |
1150
|
|
|
|
1151
|
|
|
var errors []error |
1152
|
|
|
|
1153
|
|
|
if all { |
1154
|
|
|
switch v := interface{}(m.GetTree()).(type) { |
1155
|
|
|
case interface{ ValidateAll() error }: |
1156
|
|
|
if err := v.ValidateAll(); err != nil { |
1157
|
|
|
errors = append(errors, PermissionExpandResponseValidationError{ |
1158
|
|
|
field: "Tree", |
1159
|
|
|
reason: "embedded message failed validation", |
1160
|
|
|
cause: err, |
1161
|
|
|
}) |
1162
|
|
|
} |
1163
|
|
|
case interface{ Validate() error }: |
1164
|
|
|
if err := v.Validate(); err != nil { |
1165
|
|
|
errors = append(errors, PermissionExpandResponseValidationError{ |
1166
|
|
|
field: "Tree", |
1167
|
|
|
reason: "embedded message failed validation", |
1168
|
|
|
cause: err, |
1169
|
|
|
}) |
1170
|
|
|
} |
1171
|
|
|
} |
1172
|
|
|
} else if v, ok := interface{}(m.GetTree()).(interface{ Validate() error }); ok { |
1173
|
|
|
if err := v.Validate(); err != nil { |
1174
|
|
|
return PermissionExpandResponseValidationError{ |
1175
|
|
|
field: "Tree", |
1176
|
|
|
reason: "embedded message failed validation", |
1177
|
|
|
cause: err, |
1178
|
|
|
} |
1179
|
|
|
} |
1180
|
|
|
} |
1181
|
|
|
|
1182
|
|
|
if len(errors) > 0 { |
1183
|
|
|
return PermissionExpandResponseMultiError(errors) |
1184
|
|
|
} |
1185
|
|
|
|
1186
|
|
|
return nil |
1187
|
|
|
} |
1188
|
|
|
|
1189
|
|
|
// PermissionExpandResponseMultiError is an error wrapping multiple validation |
1190
|
|
|
// errors returned by PermissionExpandResponse.ValidateAll() if the designated |
1191
|
|
|
// constraints aren't met. |
1192
|
|
|
type PermissionExpandResponseMultiError []error |
1193
|
|
|
|
1194
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1195
|
|
|
func (m PermissionExpandResponseMultiError) Error() string { |
1196
|
|
|
var msgs []string |
1197
|
|
|
for _, err := range m { |
1198
|
|
|
msgs = append(msgs, err.Error()) |
1199
|
|
|
} |
1200
|
|
|
return strings.Join(msgs, "; ") |
1201
|
|
|
} |
1202
|
|
|
|
1203
|
|
|
// AllErrors returns a list of validation violation errors. |
1204
|
|
|
func (m PermissionExpandResponseMultiError) AllErrors() []error { return m } |
1205
|
|
|
|
1206
|
|
|
// PermissionExpandResponseValidationError is the validation error returned by |
1207
|
|
|
// PermissionExpandResponse.Validate if the designated constraints aren't met. |
1208
|
|
|
type PermissionExpandResponseValidationError struct { |
1209
|
|
|
field string |
1210
|
|
|
reason string |
1211
|
|
|
cause error |
1212
|
|
|
key bool |
1213
|
|
|
} |
1214
|
|
|
|
1215
|
|
|
// Field function returns field value. |
1216
|
|
|
func (e PermissionExpandResponseValidationError) Field() string { return e.field } |
1217
|
|
|
|
1218
|
|
|
// Reason function returns reason value. |
1219
|
|
|
func (e PermissionExpandResponseValidationError) Reason() string { return e.reason } |
1220
|
|
|
|
1221
|
|
|
// Cause function returns cause value. |
1222
|
|
|
func (e PermissionExpandResponseValidationError) Cause() error { return e.cause } |
1223
|
|
|
|
1224
|
|
|
// Key function returns key value. |
1225
|
|
|
func (e PermissionExpandResponseValidationError) Key() bool { return e.key } |
1226
|
|
|
|
1227
|
|
|
// ErrorName returns error name. |
1228
|
|
|
func (e PermissionExpandResponseValidationError) ErrorName() string { |
1229
|
|
|
return "PermissionExpandResponseValidationError" |
1230
|
|
|
} |
1231
|
|
|
|
1232
|
|
|
// Error satisfies the builtin error interface |
1233
|
|
|
func (e PermissionExpandResponseValidationError) Error() string { |
1234
|
|
|
cause := "" |
1235
|
|
|
if e.cause != nil { |
1236
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1237
|
|
|
} |
1238
|
|
|
|
1239
|
|
|
key := "" |
1240
|
|
|
if e.key { |
1241
|
|
|
key = "key for " |
1242
|
|
|
} |
1243
|
|
|
|
1244
|
|
|
return fmt.Sprintf( |
1245
|
|
|
"invalid %sPermissionExpandResponse.%s: %s%s", |
1246
|
|
|
key, |
1247
|
|
|
e.field, |
1248
|
|
|
e.reason, |
1249
|
|
|
cause) |
1250
|
|
|
} |
1251
|
|
|
|
1252
|
|
|
var _ error = PermissionExpandResponseValidationError{} |
1253
|
|
|
|
1254
|
|
|
var _ interface { |
1255
|
|
|
Field() string |
1256
|
|
|
Reason() string |
1257
|
|
|
Key() bool |
1258
|
|
|
Cause() error |
1259
|
|
|
ErrorName() string |
1260
|
|
|
} = PermissionExpandResponseValidationError{} |
1261
|
|
|
|
1262
|
|
|
// Validate checks the field values on PermissionLookupEntityRequest with the |
1263
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1264
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1265
|
|
|
func (m *PermissionLookupEntityRequest) Validate() error { |
1266
|
|
|
return m.validate(false) |
1267
|
|
|
} |
1268
|
|
|
|
1269
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityRequest with |
1270
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1271
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1272
|
|
|
// PermissionLookupEntityRequestMultiError, or nil if none found. |
1273
|
|
|
func (m *PermissionLookupEntityRequest) ValidateAll() error { |
1274
|
|
|
return m.validate(true) |
1275
|
|
|
} |
1276
|
|
|
|
1277
|
|
|
func (m *PermissionLookupEntityRequest) validate(all bool) error { |
1278
|
|
|
if m == nil { |
1279
|
|
|
return nil |
1280
|
|
|
} |
1281
|
|
|
|
1282
|
|
|
var errors []error |
1283
|
|
|
|
1284
|
|
|
if len(m.GetTenantId()) > 128 { |
1285
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1286
|
|
|
field: "TenantId", |
1287
|
|
|
reason: "value length must be at most 128 bytes", |
1288
|
|
|
} |
1289
|
|
|
if !all { |
1290
|
|
|
return err |
1291
|
|
|
} |
1292
|
|
|
errors = append(errors, err) |
1293
|
|
|
} |
1294
|
|
|
|
1295
|
|
|
if !_PermissionLookupEntityRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
1296
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1297
|
|
|
field: "TenantId", |
1298
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
1299
|
|
|
} |
1300
|
|
|
if !all { |
1301
|
|
|
return err |
1302
|
|
|
} |
1303
|
|
|
errors = append(errors, err) |
1304
|
|
|
} |
1305
|
|
|
|
1306
|
|
|
if m.GetMetadata() == nil { |
1307
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1308
|
|
|
field: "Metadata", |
1309
|
|
|
reason: "value is required", |
1310
|
|
|
} |
1311
|
|
|
if !all { |
1312
|
|
|
return err |
1313
|
|
|
} |
1314
|
|
|
errors = append(errors, err) |
1315
|
|
|
} |
1316
|
|
|
|
1317
|
|
|
if all { |
1318
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
1319
|
|
|
case interface{ ValidateAll() error }: |
1320
|
|
|
if err := v.ValidateAll(); err != nil { |
1321
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1322
|
|
|
field: "Metadata", |
1323
|
|
|
reason: "embedded message failed validation", |
1324
|
|
|
cause: err, |
1325
|
|
|
}) |
1326
|
|
|
} |
1327
|
|
|
case interface{ Validate() error }: |
1328
|
|
|
if err := v.Validate(); err != nil { |
1329
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1330
|
|
|
field: "Metadata", |
1331
|
|
|
reason: "embedded message failed validation", |
1332
|
|
|
cause: err, |
1333
|
|
|
}) |
1334
|
|
|
} |
1335
|
|
|
} |
1336
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
1337
|
|
|
if err := v.Validate(); err != nil { |
1338
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1339
|
|
|
field: "Metadata", |
1340
|
|
|
reason: "embedded message failed validation", |
1341
|
|
|
cause: err, |
1342
|
|
|
} |
1343
|
|
|
} |
1344
|
|
|
} |
1345
|
|
|
|
1346
|
|
|
if len(m.GetEntityType()) > 64 { |
1347
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1348
|
|
|
field: "EntityType", |
1349
|
|
|
reason: "value length must be at most 64 bytes", |
1350
|
|
|
} |
1351
|
|
|
if !all { |
1352
|
|
|
return err |
1353
|
|
|
} |
1354
|
|
|
errors = append(errors, err) |
1355
|
|
|
} |
1356
|
|
|
|
1357
|
|
|
if !_PermissionLookupEntityRequest_EntityType_Pattern.MatchString(m.GetEntityType()) { |
1358
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1359
|
|
|
field: "EntityType", |
1360
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1361
|
|
|
} |
1362
|
|
|
if !all { |
1363
|
|
|
return err |
1364
|
|
|
} |
1365
|
|
|
errors = append(errors, err) |
1366
|
|
|
} |
1367
|
|
|
|
1368
|
|
|
if len(m.GetPermission()) > 64 { |
1369
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1370
|
|
|
field: "Permission", |
1371
|
|
|
reason: "value length must be at most 64 bytes", |
1372
|
|
|
} |
1373
|
|
|
if !all { |
1374
|
|
|
return err |
1375
|
|
|
} |
1376
|
|
|
errors = append(errors, err) |
1377
|
|
|
} |
1378
|
|
|
|
1379
|
|
|
if !_PermissionLookupEntityRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
1380
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1381
|
|
|
field: "Permission", |
1382
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
1383
|
|
|
} |
1384
|
|
|
if !all { |
1385
|
|
|
return err |
1386
|
|
|
} |
1387
|
|
|
errors = append(errors, err) |
1388
|
|
|
} |
1389
|
|
|
|
1390
|
|
|
if m.GetSubject() == nil { |
1391
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1392
|
|
|
field: "Subject", |
1393
|
|
|
reason: "value is required", |
1394
|
|
|
} |
1395
|
|
|
if !all { |
1396
|
|
|
return err |
1397
|
|
|
} |
1398
|
|
|
errors = append(errors, err) |
1399
|
|
|
} |
1400
|
|
|
|
1401
|
|
|
if all { |
1402
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
1403
|
|
|
case interface{ ValidateAll() error }: |
1404
|
|
|
if err := v.ValidateAll(); err != nil { |
1405
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1406
|
|
|
field: "Subject", |
1407
|
|
|
reason: "embedded message failed validation", |
1408
|
|
|
cause: err, |
1409
|
|
|
}) |
1410
|
|
|
} |
1411
|
|
|
case interface{ Validate() error }: |
1412
|
|
|
if err := v.Validate(); err != nil { |
1413
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1414
|
|
|
field: "Subject", |
1415
|
|
|
reason: "embedded message failed validation", |
1416
|
|
|
cause: err, |
1417
|
|
|
}) |
1418
|
|
|
} |
1419
|
|
|
} |
1420
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
1421
|
|
|
if err := v.Validate(); err != nil { |
1422
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1423
|
|
|
field: "Subject", |
1424
|
|
|
reason: "embedded message failed validation", |
1425
|
|
|
cause: err, |
1426
|
|
|
} |
1427
|
|
|
} |
1428
|
|
|
} |
1429
|
|
|
|
1430
|
|
|
if all { |
1431
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
1432
|
|
|
case interface{ ValidateAll() error }: |
1433
|
|
|
if err := v.ValidateAll(); err != nil { |
1434
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1435
|
|
|
field: "Context", |
1436
|
|
|
reason: "embedded message failed validation", |
1437
|
|
|
cause: err, |
1438
|
|
|
}) |
1439
|
|
|
} |
1440
|
|
|
case interface{ Validate() error }: |
1441
|
|
|
if err := v.Validate(); err != nil { |
1442
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1443
|
|
|
field: "Context", |
1444
|
|
|
reason: "embedded message failed validation", |
1445
|
|
|
cause: err, |
1446
|
|
|
}) |
1447
|
|
|
} |
1448
|
|
|
} |
1449
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
1450
|
|
|
if err := v.Validate(); err != nil { |
1451
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1452
|
|
|
field: "Context", |
1453
|
|
|
reason: "embedded message failed validation", |
1454
|
|
|
cause: err, |
1455
|
|
|
} |
1456
|
|
|
} |
1457
|
|
|
} |
1458
|
|
|
|
1459
|
|
|
{ |
1460
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
1461
|
|
|
i := 0 |
1462
|
|
|
for key := range m.GetScope() { |
1463
|
|
|
sorted_keys[i] = key |
1464
|
|
|
i++ |
1465
|
|
|
} |
1466
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
1467
|
|
|
for _, key := range sorted_keys { |
1468
|
|
|
val := m.GetScope()[key] |
1469
|
|
|
_ = val |
1470
|
|
|
|
1471
|
|
|
// no validation rules for Scope[key] |
1472
|
|
|
|
1473
|
|
|
if all { |
1474
|
|
|
switch v := interface{}(val).(type) { |
1475
|
|
|
case interface{ ValidateAll() error }: |
1476
|
|
|
if err := v.ValidateAll(); err != nil { |
1477
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1478
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1479
|
|
|
reason: "embedded message failed validation", |
1480
|
|
|
cause: err, |
1481
|
|
|
}) |
1482
|
|
|
} |
1483
|
|
|
case interface{ Validate() error }: |
1484
|
|
|
if err := v.Validate(); err != nil { |
1485
|
|
|
errors = append(errors, PermissionLookupEntityRequestValidationError{ |
1486
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1487
|
|
|
reason: "embedded message failed validation", |
1488
|
|
|
cause: err, |
1489
|
|
|
}) |
1490
|
|
|
} |
1491
|
|
|
} |
1492
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
1493
|
|
|
if err := v.Validate(); err != nil { |
1494
|
|
|
return PermissionLookupEntityRequestValidationError{ |
1495
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
1496
|
|
|
reason: "embedded message failed validation", |
1497
|
|
|
cause: err, |
1498
|
|
|
} |
1499
|
|
|
} |
1500
|
|
|
} |
1501
|
|
|
|
1502
|
|
|
} |
1503
|
|
|
} |
1504
|
|
|
|
1505
|
|
|
if m.GetPageSize() != 0 { |
1506
|
|
|
|
1507
|
|
|
if m.GetPageSize() < 1 { |
1508
|
|
|
err := PermissionLookupEntityRequestValidationError{ |
1509
|
|
|
field: "PageSize", |
1510
|
|
|
reason: "value must be greater than or equal to 1", |
1511
|
|
|
} |
1512
|
|
|
if !all { |
1513
|
|
|
return err |
1514
|
|
|
} |
1515
|
|
|
errors = append(errors, err) |
1516
|
|
|
} |
1517
|
|
|
|
1518
|
|
|
} |
1519
|
|
|
|
1520
|
|
|
if m.GetContinuousToken() != "" { |
1521
|
|
|
|
1522
|
|
|
} |
1523
|
|
|
|
1524
|
|
|
if len(errors) > 0 { |
1525
|
|
|
return PermissionLookupEntityRequestMultiError(errors) |
1526
|
|
|
} |
1527
|
|
|
|
1528
|
|
|
return nil |
1529
|
|
|
} |
1530
|
|
|
|
1531
|
|
|
// PermissionLookupEntityRequestMultiError is an error wrapping multiple |
1532
|
|
|
// validation errors returned by PermissionLookupEntityRequest.ValidateAll() |
1533
|
|
|
// if the designated constraints aren't met. |
1534
|
|
|
type PermissionLookupEntityRequestMultiError []error |
1535
|
|
|
|
1536
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1537
|
|
|
func (m PermissionLookupEntityRequestMultiError) Error() string { |
1538
|
|
|
var msgs []string |
1539
|
|
|
for _, err := range m { |
1540
|
|
|
msgs = append(msgs, err.Error()) |
1541
|
|
|
} |
1542
|
|
|
return strings.Join(msgs, "; ") |
1543
|
|
|
} |
1544
|
|
|
|
1545
|
|
|
// AllErrors returns a list of validation violation errors. |
1546
|
|
|
func (m PermissionLookupEntityRequestMultiError) AllErrors() []error { return m } |
1547
|
|
|
|
1548
|
|
|
// PermissionLookupEntityRequestValidationError is the validation error |
1549
|
|
|
// returned by PermissionLookupEntityRequest.Validate if the designated |
1550
|
|
|
// constraints aren't met. |
1551
|
|
|
type PermissionLookupEntityRequestValidationError struct { |
1552
|
|
|
field string |
1553
|
|
|
reason string |
1554
|
|
|
cause error |
1555
|
|
|
key bool |
1556
|
|
|
} |
1557
|
|
|
|
1558
|
|
|
// Field function returns field value. |
1559
|
|
|
func (e PermissionLookupEntityRequestValidationError) Field() string { return e.field } |
1560
|
|
|
|
1561
|
|
|
// Reason function returns reason value. |
1562
|
|
|
func (e PermissionLookupEntityRequestValidationError) Reason() string { return e.reason } |
1563
|
|
|
|
1564
|
|
|
// Cause function returns cause value. |
1565
|
|
|
func (e PermissionLookupEntityRequestValidationError) Cause() error { return e.cause } |
1566
|
|
|
|
1567
|
|
|
// Key function returns key value. |
1568
|
|
|
func (e PermissionLookupEntityRequestValidationError) Key() bool { return e.key } |
1569
|
|
|
|
1570
|
|
|
// ErrorName returns error name. |
1571
|
|
|
func (e PermissionLookupEntityRequestValidationError) ErrorName() string { |
1572
|
|
|
return "PermissionLookupEntityRequestValidationError" |
1573
|
|
|
} |
1574
|
|
|
|
1575
|
|
|
// Error satisfies the builtin error interface |
1576
|
|
|
func (e PermissionLookupEntityRequestValidationError) Error() string { |
1577
|
|
|
cause := "" |
1578
|
|
|
if e.cause != nil { |
1579
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1580
|
|
|
} |
1581
|
|
|
|
1582
|
|
|
key := "" |
1583
|
|
|
if e.key { |
1584
|
|
|
key = "key for " |
1585
|
|
|
} |
1586
|
|
|
|
1587
|
|
|
return fmt.Sprintf( |
1588
|
|
|
"invalid %sPermissionLookupEntityRequest.%s: %s%s", |
1589
|
|
|
key, |
1590
|
|
|
e.field, |
1591
|
|
|
e.reason, |
1592
|
|
|
cause) |
1593
|
|
|
} |
1594
|
|
|
|
1595
|
|
|
var _ error = PermissionLookupEntityRequestValidationError{} |
1596
|
|
|
|
1597
|
|
|
var _ interface { |
1598
|
|
|
Field() string |
1599
|
|
|
Reason() string |
1600
|
|
|
Key() bool |
1601
|
|
|
Cause() error |
1602
|
|
|
ErrorName() string |
1603
|
|
|
} = PermissionLookupEntityRequestValidationError{} |
1604
|
|
|
|
1605
|
|
|
var _PermissionLookupEntityRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
1606
|
|
|
|
1607
|
|
|
var _PermissionLookupEntityRequest_EntityType_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1608
|
|
|
|
1609
|
|
|
var _PermissionLookupEntityRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
1610
|
|
|
|
1611
|
|
|
// Validate checks the field values on PermissionLookupEntityRequestMetadata |
1612
|
|
|
// with the rules defined in the proto definition for this message. If any |
1613
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
1614
|
|
|
// there are no violations. |
1615
|
|
|
func (m *PermissionLookupEntityRequestMetadata) Validate() error { |
1616
|
|
|
return m.validate(false) |
1617
|
|
|
} |
1618
|
|
|
|
1619
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityRequestMetadata |
1620
|
|
|
// with the rules defined in the proto definition for this message. If any |
1621
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
1622
|
|
|
// PermissionLookupEntityRequestMetadataMultiError, or nil if none found. |
1623
|
|
|
func (m *PermissionLookupEntityRequestMetadata) ValidateAll() error { |
1624
|
|
|
return m.validate(true) |
1625
|
|
|
} |
1626
|
|
|
|
1627
|
|
|
func (m *PermissionLookupEntityRequestMetadata) validate(all bool) error { |
1628
|
|
|
if m == nil { |
1629
|
|
|
return nil |
1630
|
|
|
} |
1631
|
|
|
|
1632
|
|
|
var errors []error |
1633
|
|
|
|
1634
|
|
|
// no validation rules for SchemaVersion |
1635
|
|
|
|
1636
|
|
|
// no validation rules for SnapToken |
1637
|
|
|
|
1638
|
|
|
if m.GetDepth() < 3 { |
1639
|
|
|
err := PermissionLookupEntityRequestMetadataValidationError{ |
1640
|
|
|
field: "Depth", |
1641
|
|
|
reason: "value must be greater than or equal to 3", |
1642
|
|
|
} |
1643
|
|
|
if !all { |
1644
|
|
|
return err |
1645
|
|
|
} |
1646
|
|
|
errors = append(errors, err) |
1647
|
|
|
} |
1648
|
|
|
|
1649
|
|
|
if len(errors) > 0 { |
1650
|
|
|
return PermissionLookupEntityRequestMetadataMultiError(errors) |
1651
|
|
|
} |
1652
|
|
|
|
1653
|
|
|
return nil |
1654
|
|
|
} |
1655
|
|
|
|
1656
|
|
|
// PermissionLookupEntityRequestMetadataMultiError is an error wrapping |
1657
|
|
|
// multiple validation errors returned by |
1658
|
|
|
// PermissionLookupEntityRequestMetadata.ValidateAll() if the designated |
1659
|
|
|
// constraints aren't met. |
1660
|
|
|
type PermissionLookupEntityRequestMetadataMultiError []error |
1661
|
|
|
|
1662
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1663
|
|
|
func (m PermissionLookupEntityRequestMetadataMultiError) Error() string { |
1664
|
|
|
var msgs []string |
1665
|
|
|
for _, err := range m { |
1666
|
|
|
msgs = append(msgs, err.Error()) |
1667
|
|
|
} |
1668
|
|
|
return strings.Join(msgs, "; ") |
1669
|
|
|
} |
1670
|
|
|
|
1671
|
|
|
// AllErrors returns a list of validation violation errors. |
1672
|
|
|
func (m PermissionLookupEntityRequestMetadataMultiError) AllErrors() []error { return m } |
1673
|
|
|
|
1674
|
|
|
// PermissionLookupEntityRequestMetadataValidationError is the validation error |
1675
|
|
|
// returned by PermissionLookupEntityRequestMetadata.Validate if the |
1676
|
|
|
// designated constraints aren't met. |
1677
|
|
|
type PermissionLookupEntityRequestMetadataValidationError struct { |
1678
|
|
|
field string |
1679
|
|
|
reason string |
1680
|
|
|
cause error |
1681
|
|
|
key bool |
1682
|
|
|
} |
1683
|
|
|
|
1684
|
|
|
// Field function returns field value. |
1685
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Field() string { return e.field } |
1686
|
|
|
|
1687
|
|
|
// Reason function returns reason value. |
1688
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Reason() string { return e.reason } |
1689
|
|
|
|
1690
|
|
|
// Cause function returns cause value. |
1691
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Cause() error { return e.cause } |
1692
|
|
|
|
1693
|
|
|
// Key function returns key value. |
1694
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Key() bool { return e.key } |
1695
|
|
|
|
1696
|
|
|
// ErrorName returns error name. |
1697
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) ErrorName() string { |
1698
|
|
|
return "PermissionLookupEntityRequestMetadataValidationError" |
1699
|
|
|
} |
1700
|
|
|
|
1701
|
|
|
// Error satisfies the builtin error interface |
1702
|
|
|
func (e PermissionLookupEntityRequestMetadataValidationError) Error() string { |
1703
|
|
|
cause := "" |
1704
|
|
|
if e.cause != nil { |
1705
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1706
|
|
|
} |
1707
|
|
|
|
1708
|
|
|
key := "" |
1709
|
|
|
if e.key { |
1710
|
|
|
key = "key for " |
1711
|
|
|
} |
1712
|
|
|
|
1713
|
|
|
return fmt.Sprintf( |
1714
|
|
|
"invalid %sPermissionLookupEntityRequestMetadata.%s: %s%s", |
1715
|
|
|
key, |
1716
|
|
|
e.field, |
1717
|
|
|
e.reason, |
1718
|
|
|
cause) |
1719
|
|
|
} |
1720
|
|
|
|
1721
|
|
|
var _ error = PermissionLookupEntityRequestMetadataValidationError{} |
1722
|
|
|
|
1723
|
|
|
var _ interface { |
1724
|
|
|
Field() string |
1725
|
|
|
Reason() string |
1726
|
|
|
Key() bool |
1727
|
|
|
Cause() error |
1728
|
|
|
ErrorName() string |
1729
|
|
|
} = PermissionLookupEntityRequestMetadataValidationError{} |
1730
|
|
|
|
1731
|
|
|
// Validate checks the field values on PermissionLookupEntityResponse with the |
1732
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1733
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1734
|
|
|
func (m *PermissionLookupEntityResponse) Validate() error { |
1735
|
|
|
return m.validate(false) |
1736
|
|
|
} |
1737
|
|
|
|
1738
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityResponse with |
1739
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1740
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1741
|
|
|
// PermissionLookupEntityResponseMultiError, or nil if none found. |
1742
|
|
|
func (m *PermissionLookupEntityResponse) ValidateAll() error { |
1743
|
|
|
return m.validate(true) |
1744
|
|
|
} |
1745
|
|
|
|
1746
|
|
|
func (m *PermissionLookupEntityResponse) validate(all bool) error { |
1747
|
|
|
if m == nil { |
1748
|
|
|
return nil |
1749
|
|
|
} |
1750
|
|
|
|
1751
|
|
|
var errors []error |
1752
|
|
|
|
1753
|
|
|
// no validation rules for ContinuousToken |
1754
|
|
|
|
1755
|
|
|
if len(errors) > 0 { |
1756
|
|
|
return PermissionLookupEntityResponseMultiError(errors) |
1757
|
|
|
} |
1758
|
|
|
|
1759
|
|
|
return nil |
1760
|
|
|
} |
1761
|
|
|
|
1762
|
|
|
// PermissionLookupEntityResponseMultiError is an error wrapping multiple |
1763
|
|
|
// validation errors returned by PermissionLookupEntityResponse.ValidateAll() |
1764
|
|
|
// if the designated constraints aren't met. |
1765
|
|
|
type PermissionLookupEntityResponseMultiError []error |
1766
|
|
|
|
1767
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1768
|
|
|
func (m PermissionLookupEntityResponseMultiError) Error() string { |
1769
|
|
|
var msgs []string |
1770
|
|
|
for _, err := range m { |
1771
|
|
|
msgs = append(msgs, err.Error()) |
1772
|
|
|
} |
1773
|
|
|
return strings.Join(msgs, "; ") |
1774
|
|
|
} |
1775
|
|
|
|
1776
|
|
|
// AllErrors returns a list of validation violation errors. |
1777
|
|
|
func (m PermissionLookupEntityResponseMultiError) AllErrors() []error { return m } |
1778
|
|
|
|
1779
|
|
|
// PermissionLookupEntityResponseValidationError is the validation error |
1780
|
|
|
// returned by PermissionLookupEntityResponse.Validate if the designated |
1781
|
|
|
// constraints aren't met. |
1782
|
|
|
type PermissionLookupEntityResponseValidationError struct { |
1783
|
|
|
field string |
1784
|
|
|
reason string |
1785
|
|
|
cause error |
1786
|
|
|
key bool |
1787
|
|
|
} |
1788
|
|
|
|
1789
|
|
|
// Field function returns field value. |
1790
|
|
|
func (e PermissionLookupEntityResponseValidationError) Field() string { return e.field } |
1791
|
|
|
|
1792
|
|
|
// Reason function returns reason value. |
1793
|
|
|
func (e PermissionLookupEntityResponseValidationError) Reason() string { return e.reason } |
1794
|
|
|
|
1795
|
|
|
// Cause function returns cause value. |
1796
|
|
|
func (e PermissionLookupEntityResponseValidationError) Cause() error { return e.cause } |
1797
|
|
|
|
1798
|
|
|
// Key function returns key value. |
1799
|
|
|
func (e PermissionLookupEntityResponseValidationError) Key() bool { return e.key } |
1800
|
|
|
|
1801
|
|
|
// ErrorName returns error name. |
1802
|
|
|
func (e PermissionLookupEntityResponseValidationError) ErrorName() string { |
1803
|
|
|
return "PermissionLookupEntityResponseValidationError" |
1804
|
|
|
} |
1805
|
|
|
|
1806
|
|
|
// Error satisfies the builtin error interface |
1807
|
|
|
func (e PermissionLookupEntityResponseValidationError) Error() string { |
1808
|
|
|
cause := "" |
1809
|
|
|
if e.cause != nil { |
1810
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1811
|
|
|
} |
1812
|
|
|
|
1813
|
|
|
key := "" |
1814
|
|
|
if e.key { |
1815
|
|
|
key = "key for " |
1816
|
|
|
} |
1817
|
|
|
|
1818
|
|
|
return fmt.Sprintf( |
1819
|
|
|
"invalid %sPermissionLookupEntityResponse.%s: %s%s", |
1820
|
|
|
key, |
1821
|
|
|
e.field, |
1822
|
|
|
e.reason, |
1823
|
|
|
cause) |
1824
|
|
|
} |
1825
|
|
|
|
1826
|
|
|
var _ error = PermissionLookupEntityResponseValidationError{} |
1827
|
|
|
|
1828
|
|
|
var _ interface { |
1829
|
|
|
Field() string |
1830
|
|
|
Reason() string |
1831
|
|
|
Key() bool |
1832
|
|
|
Cause() error |
1833
|
|
|
ErrorName() string |
1834
|
|
|
} = PermissionLookupEntityResponseValidationError{} |
1835
|
|
|
|
1836
|
|
|
// Validate checks the field values on PermissionLookupEntityStreamResponse |
1837
|
|
|
// with the rules defined in the proto definition for this message. If any |
1838
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
1839
|
|
|
// there are no violations. |
1840
|
|
|
func (m *PermissionLookupEntityStreamResponse) Validate() error { |
1841
|
|
|
return m.validate(false) |
1842
|
|
|
} |
1843
|
|
|
|
1844
|
|
|
// ValidateAll checks the field values on PermissionLookupEntityStreamResponse |
1845
|
|
|
// with the rules defined in the proto definition for this message. If any |
1846
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
1847
|
|
|
// PermissionLookupEntityStreamResponseMultiError, or nil if none found. |
1848
|
|
|
func (m *PermissionLookupEntityStreamResponse) ValidateAll() error { |
1849
|
|
|
return m.validate(true) |
1850
|
|
|
} |
1851
|
|
|
|
1852
|
|
|
func (m *PermissionLookupEntityStreamResponse) validate(all bool) error { |
1853
|
|
|
if m == nil { |
1854
|
|
|
return nil |
1855
|
|
|
} |
1856
|
|
|
|
1857
|
|
|
var errors []error |
1858
|
|
|
|
1859
|
|
|
// no validation rules for EntityId |
1860
|
|
|
|
1861
|
|
|
// no validation rules for ContinuousToken |
1862
|
|
|
|
1863
|
|
|
if len(errors) > 0 { |
1864
|
|
|
return PermissionLookupEntityStreamResponseMultiError(errors) |
1865
|
|
|
} |
1866
|
|
|
|
1867
|
|
|
return nil |
1868
|
|
|
} |
1869
|
|
|
|
1870
|
|
|
// PermissionLookupEntityStreamResponseMultiError is an error wrapping multiple |
1871
|
|
|
// validation errors returned by |
1872
|
|
|
// PermissionLookupEntityStreamResponse.ValidateAll() if the designated |
1873
|
|
|
// constraints aren't met. |
1874
|
|
|
type PermissionLookupEntityStreamResponseMultiError []error |
1875
|
|
|
|
1876
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
1877
|
|
|
func (m PermissionLookupEntityStreamResponseMultiError) Error() string { |
1878
|
|
|
var msgs []string |
1879
|
|
|
for _, err := range m { |
1880
|
|
|
msgs = append(msgs, err.Error()) |
1881
|
|
|
} |
1882
|
|
|
return strings.Join(msgs, "; ") |
1883
|
|
|
} |
1884
|
|
|
|
1885
|
|
|
// AllErrors returns a list of validation violation errors. |
1886
|
|
|
func (m PermissionLookupEntityStreamResponseMultiError) AllErrors() []error { return m } |
1887
|
|
|
|
1888
|
|
|
// PermissionLookupEntityStreamResponseValidationError is the validation error |
1889
|
|
|
// returned by PermissionLookupEntityStreamResponse.Validate if the designated |
1890
|
|
|
// constraints aren't met. |
1891
|
|
|
type PermissionLookupEntityStreamResponseValidationError struct { |
1892
|
|
|
field string |
1893
|
|
|
reason string |
1894
|
|
|
cause error |
1895
|
|
|
key bool |
1896
|
|
|
} |
1897
|
|
|
|
1898
|
|
|
// Field function returns field value. |
1899
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Field() string { return e.field } |
1900
|
|
|
|
1901
|
|
|
// Reason function returns reason value. |
1902
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Reason() string { return e.reason } |
1903
|
|
|
|
1904
|
|
|
// Cause function returns cause value. |
1905
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Cause() error { return e.cause } |
1906
|
|
|
|
1907
|
|
|
// Key function returns key value. |
1908
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Key() bool { return e.key } |
1909
|
|
|
|
1910
|
|
|
// ErrorName returns error name. |
1911
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) ErrorName() string { |
1912
|
|
|
return "PermissionLookupEntityStreamResponseValidationError" |
1913
|
|
|
} |
1914
|
|
|
|
1915
|
|
|
// Error satisfies the builtin error interface |
1916
|
|
|
func (e PermissionLookupEntityStreamResponseValidationError) Error() string { |
1917
|
|
|
cause := "" |
1918
|
|
|
if e.cause != nil { |
1919
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
1920
|
|
|
} |
1921
|
|
|
|
1922
|
|
|
key := "" |
1923
|
|
|
if e.key { |
1924
|
|
|
key = "key for " |
1925
|
|
|
} |
1926
|
|
|
|
1927
|
|
|
return fmt.Sprintf( |
1928
|
|
|
"invalid %sPermissionLookupEntityStreamResponse.%s: %s%s", |
1929
|
|
|
key, |
1930
|
|
|
e.field, |
1931
|
|
|
e.reason, |
1932
|
|
|
cause) |
1933
|
|
|
} |
1934
|
|
|
|
1935
|
|
|
var _ error = PermissionLookupEntityStreamResponseValidationError{} |
1936
|
|
|
|
1937
|
|
|
var _ interface { |
1938
|
|
|
Field() string |
1939
|
|
|
Reason() string |
1940
|
|
|
Key() bool |
1941
|
|
|
Cause() error |
1942
|
|
|
ErrorName() string |
1943
|
|
|
} = PermissionLookupEntityStreamResponseValidationError{} |
1944
|
|
|
|
1945
|
|
|
// Validate checks the field values on PermissionEntityFilterRequest with the |
1946
|
|
|
// rules defined in the proto definition for this message. If any rules are |
1947
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
1948
|
|
|
func (m *PermissionEntityFilterRequest) Validate() error { |
1949
|
|
|
return m.validate(false) |
1950
|
|
|
} |
1951
|
|
|
|
1952
|
|
|
// ValidateAll checks the field values on PermissionEntityFilterRequest with |
1953
|
|
|
// the rules defined in the proto definition for this message. If any rules |
1954
|
|
|
// are violated, the result is a list of violation errors wrapped in |
1955
|
|
|
// PermissionEntityFilterRequestMultiError, or nil if none found. |
1956
|
|
|
func (m *PermissionEntityFilterRequest) ValidateAll() error { |
1957
|
|
|
return m.validate(true) |
1958
|
|
|
} |
1959
|
|
|
|
1960
|
|
|
func (m *PermissionEntityFilterRequest) validate(all bool) error { |
1961
|
|
|
if m == nil { |
1962
|
|
|
return nil |
1963
|
|
|
} |
1964
|
|
|
|
1965
|
|
|
var errors []error |
1966
|
|
|
|
1967
|
|
|
if len(m.GetTenantId()) > 128 { |
1968
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
1969
|
|
|
field: "TenantId", |
1970
|
|
|
reason: "value length must be at most 128 bytes", |
1971
|
|
|
} |
1972
|
|
|
if !all { |
1973
|
|
|
return err |
1974
|
|
|
} |
1975
|
|
|
errors = append(errors, err) |
1976
|
|
|
} |
1977
|
|
|
|
1978
|
|
|
if !_PermissionEntityFilterRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
1979
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
1980
|
|
|
field: "TenantId", |
1981
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
1982
|
|
|
} |
1983
|
|
|
if !all { |
1984
|
|
|
return err |
1985
|
|
|
} |
1986
|
|
|
errors = append(errors, err) |
1987
|
|
|
} |
1988
|
|
|
|
1989
|
|
|
if m.GetMetadata() == nil { |
1990
|
|
|
err := PermissionEntityFilterRequestValidationError{ |
1991
|
|
|
field: "Metadata", |
1992
|
|
|
reason: "value is required", |
1993
|
|
|
} |
1994
|
|
|
if !all { |
1995
|
|
|
return err |
1996
|
|
|
} |
1997
|
|
|
errors = append(errors, err) |
1998
|
|
|
} |
1999
|
|
|
|
2000
|
|
|
if all { |
2001
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
2002
|
|
|
case interface{ ValidateAll() error }: |
2003
|
|
|
if err := v.ValidateAll(); err != nil { |
2004
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2005
|
|
|
field: "Metadata", |
2006
|
|
|
reason: "embedded message failed validation", |
2007
|
|
|
cause: err, |
2008
|
|
|
}) |
2009
|
|
|
} |
2010
|
|
|
case interface{ Validate() error }: |
2011
|
|
|
if err := v.Validate(); err != nil { |
2012
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2013
|
|
|
field: "Metadata", |
2014
|
|
|
reason: "embedded message failed validation", |
2015
|
|
|
cause: err, |
2016
|
|
|
}) |
2017
|
|
|
} |
2018
|
|
|
} |
2019
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
2020
|
|
|
if err := v.Validate(); err != nil { |
2021
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2022
|
|
|
field: "Metadata", |
2023
|
|
|
reason: "embedded message failed validation", |
2024
|
|
|
cause: err, |
2025
|
|
|
} |
2026
|
|
|
} |
2027
|
|
|
} |
2028
|
|
|
|
2029
|
|
|
if all { |
2030
|
|
|
switch v := interface{}(m.GetEntrance()).(type) { |
2031
|
|
|
case interface{ ValidateAll() error }: |
2032
|
|
|
if err := v.ValidateAll(); err != nil { |
2033
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2034
|
|
|
field: "Entrance", |
2035
|
|
|
reason: "embedded message failed validation", |
2036
|
|
|
cause: err, |
2037
|
|
|
}) |
2038
|
|
|
} |
2039
|
|
|
case interface{ Validate() error }: |
2040
|
|
|
if err := v.Validate(); err != nil { |
2041
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2042
|
|
|
field: "Entrance", |
2043
|
|
|
reason: "embedded message failed validation", |
2044
|
|
|
cause: err, |
2045
|
|
|
}) |
2046
|
|
|
} |
2047
|
|
|
} |
2048
|
|
|
} else if v, ok := interface{}(m.GetEntrance()).(interface{ Validate() error }); ok { |
2049
|
|
|
if err := v.Validate(); err != nil { |
2050
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2051
|
|
|
field: "Entrance", |
2052
|
|
|
reason: "embedded message failed validation", |
2053
|
|
|
cause: err, |
2054
|
|
|
} |
2055
|
|
|
} |
2056
|
|
|
} |
2057
|
|
|
|
2058
|
|
|
if all { |
2059
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
2060
|
|
|
case interface{ ValidateAll() error }: |
2061
|
|
|
if err := v.ValidateAll(); err != nil { |
2062
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2063
|
|
|
field: "Subject", |
2064
|
|
|
reason: "embedded message failed validation", |
2065
|
|
|
cause: err, |
2066
|
|
|
}) |
2067
|
|
|
} |
2068
|
|
|
case interface{ Validate() error }: |
2069
|
|
|
if err := v.Validate(); err != nil { |
2070
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2071
|
|
|
field: "Subject", |
2072
|
|
|
reason: "embedded message failed validation", |
2073
|
|
|
cause: err, |
2074
|
|
|
}) |
2075
|
|
|
} |
2076
|
|
|
} |
2077
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
2078
|
|
|
if err := v.Validate(); err != nil { |
2079
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2080
|
|
|
field: "Subject", |
2081
|
|
|
reason: "embedded message failed validation", |
2082
|
|
|
cause: err, |
2083
|
|
|
} |
2084
|
|
|
} |
2085
|
|
|
} |
2086
|
|
|
|
2087
|
|
|
if all { |
2088
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
2089
|
|
|
case interface{ ValidateAll() error }: |
2090
|
|
|
if err := v.ValidateAll(); err != nil { |
2091
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2092
|
|
|
field: "Context", |
2093
|
|
|
reason: "embedded message failed validation", |
2094
|
|
|
cause: err, |
2095
|
|
|
}) |
2096
|
|
|
} |
2097
|
|
|
case interface{ Validate() error }: |
2098
|
|
|
if err := v.Validate(); err != nil { |
2099
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2100
|
|
|
field: "Context", |
2101
|
|
|
reason: "embedded message failed validation", |
2102
|
|
|
cause: err, |
2103
|
|
|
}) |
2104
|
|
|
} |
2105
|
|
|
} |
2106
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
2107
|
|
|
if err := v.Validate(); err != nil { |
2108
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2109
|
|
|
field: "Context", |
2110
|
|
|
reason: "embedded message failed validation", |
2111
|
|
|
cause: err, |
2112
|
|
|
} |
2113
|
|
|
} |
2114
|
|
|
} |
2115
|
|
|
|
2116
|
|
|
{ |
2117
|
|
|
sorted_keys := make([]string, len(m.GetScope())) |
2118
|
|
|
i := 0 |
2119
|
|
|
for key := range m.GetScope() { |
2120
|
|
|
sorted_keys[i] = key |
2121
|
|
|
i++ |
2122
|
|
|
} |
2123
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
2124
|
|
|
for _, key := range sorted_keys { |
2125
|
|
|
val := m.GetScope()[key] |
2126
|
|
|
_ = val |
2127
|
|
|
|
2128
|
|
|
// no validation rules for Scope[key] |
2129
|
|
|
|
2130
|
|
|
if all { |
2131
|
|
|
switch v := interface{}(val).(type) { |
2132
|
|
|
case interface{ ValidateAll() error }: |
2133
|
|
|
if err := v.ValidateAll(); err != nil { |
2134
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2135
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2136
|
|
|
reason: "embedded message failed validation", |
2137
|
|
|
cause: err, |
2138
|
|
|
}) |
2139
|
|
|
} |
2140
|
|
|
case interface{ Validate() error }: |
2141
|
|
|
if err := v.Validate(); err != nil { |
2142
|
|
|
errors = append(errors, PermissionEntityFilterRequestValidationError{ |
2143
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2144
|
|
|
reason: "embedded message failed validation", |
2145
|
|
|
cause: err, |
2146
|
|
|
}) |
2147
|
|
|
} |
2148
|
|
|
} |
2149
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
2150
|
|
|
if err := v.Validate(); err != nil { |
2151
|
|
|
return PermissionEntityFilterRequestValidationError{ |
2152
|
|
|
field: fmt.Sprintf("Scope[%v]", key), |
2153
|
|
|
reason: "embedded message failed validation", |
2154
|
|
|
cause: err, |
2155
|
|
|
} |
2156
|
|
|
} |
2157
|
|
|
} |
2158
|
|
|
|
2159
|
|
|
} |
2160
|
|
|
} |
2161
|
|
|
|
2162
|
|
|
if m.GetCursor() != "" { |
2163
|
|
|
|
2164
|
|
|
} |
2165
|
|
|
|
2166
|
|
|
if len(errors) > 0 { |
2167
|
|
|
return PermissionEntityFilterRequestMultiError(errors) |
2168
|
|
|
} |
2169
|
|
|
|
2170
|
|
|
return nil |
2171
|
|
|
} |
2172
|
|
|
|
2173
|
|
|
// PermissionEntityFilterRequestMultiError is an error wrapping multiple |
2174
|
|
|
// validation errors returned by PermissionEntityFilterRequest.ValidateAll() |
2175
|
|
|
// if the designated constraints aren't met. |
2176
|
|
|
type PermissionEntityFilterRequestMultiError []error |
2177
|
|
|
|
2178
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2179
|
|
|
func (m PermissionEntityFilterRequestMultiError) Error() string { |
2180
|
|
|
var msgs []string |
2181
|
|
|
for _, err := range m { |
2182
|
|
|
msgs = append(msgs, err.Error()) |
2183
|
|
|
} |
2184
|
|
|
return strings.Join(msgs, "; ") |
2185
|
|
|
} |
2186
|
|
|
|
2187
|
|
|
// AllErrors returns a list of validation violation errors. |
2188
|
|
|
func (m PermissionEntityFilterRequestMultiError) AllErrors() []error { return m } |
2189
|
|
|
|
2190
|
|
|
// PermissionEntityFilterRequestValidationError is the validation error |
2191
|
|
|
// returned by PermissionEntityFilterRequest.Validate if the designated |
2192
|
|
|
// constraints aren't met. |
2193
|
|
|
type PermissionEntityFilterRequestValidationError struct { |
2194
|
|
|
field string |
2195
|
|
|
reason string |
2196
|
|
|
cause error |
2197
|
|
|
key bool |
2198
|
|
|
} |
2199
|
|
|
|
2200
|
|
|
// Field function returns field value. |
2201
|
|
|
func (e PermissionEntityFilterRequestValidationError) Field() string { return e.field } |
2202
|
|
|
|
2203
|
|
|
// Reason function returns reason value. |
2204
|
|
|
func (e PermissionEntityFilterRequestValidationError) Reason() string { return e.reason } |
2205
|
|
|
|
2206
|
|
|
// Cause function returns cause value. |
2207
|
|
|
func (e PermissionEntityFilterRequestValidationError) Cause() error { return e.cause } |
2208
|
|
|
|
2209
|
|
|
// Key function returns key value. |
2210
|
|
|
func (e PermissionEntityFilterRequestValidationError) Key() bool { return e.key } |
2211
|
|
|
|
2212
|
|
|
// ErrorName returns error name. |
2213
|
|
|
func (e PermissionEntityFilterRequestValidationError) ErrorName() string { |
2214
|
|
|
return "PermissionEntityFilterRequestValidationError" |
2215
|
|
|
} |
2216
|
|
|
|
2217
|
|
|
// Error satisfies the builtin error interface |
2218
|
|
|
func (e PermissionEntityFilterRequestValidationError) Error() string { |
2219
|
|
|
cause := "" |
2220
|
|
|
if e.cause != nil { |
2221
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2222
|
|
|
} |
2223
|
|
|
|
2224
|
|
|
key := "" |
2225
|
|
|
if e.key { |
2226
|
|
|
key = "key for " |
2227
|
|
|
} |
2228
|
|
|
|
2229
|
|
|
return fmt.Sprintf( |
2230
|
|
|
"invalid %sPermissionEntityFilterRequest.%s: %s%s", |
2231
|
|
|
key, |
2232
|
|
|
e.field, |
2233
|
|
|
e.reason, |
2234
|
|
|
cause) |
2235
|
|
|
} |
2236
|
|
|
|
2237
|
|
|
var _ error = PermissionEntityFilterRequestValidationError{} |
2238
|
|
|
|
2239
|
|
|
var _ interface { |
2240
|
|
|
Field() string |
2241
|
|
|
Reason() string |
2242
|
|
|
Key() bool |
2243
|
|
|
Cause() error |
2244
|
|
|
ErrorName() string |
2245
|
|
|
} = PermissionEntityFilterRequestValidationError{} |
2246
|
|
|
|
2247
|
|
|
var _PermissionEntityFilterRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
2248
|
|
|
|
2249
|
|
|
// Validate checks the field values on PermissionEntityFilterRequestMetadata |
2250
|
|
|
// with the rules defined in the proto definition for this message. If any |
2251
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2252
|
|
|
// there are no violations. |
2253
|
|
|
func (m *PermissionEntityFilterRequestMetadata) Validate() error { |
2254
|
|
|
return m.validate(false) |
2255
|
|
|
} |
2256
|
|
|
|
2257
|
|
|
// ValidateAll checks the field values on PermissionEntityFilterRequestMetadata |
2258
|
|
|
// with the rules defined in the proto definition for this message. If any |
2259
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2260
|
|
|
// PermissionEntityFilterRequestMetadataMultiError, or nil if none found. |
2261
|
|
|
func (m *PermissionEntityFilterRequestMetadata) ValidateAll() error { |
2262
|
|
|
return m.validate(true) |
2263
|
|
|
} |
2264
|
|
|
|
2265
|
|
|
func (m *PermissionEntityFilterRequestMetadata) validate(all bool) error { |
2266
|
|
|
if m == nil { |
2267
|
|
|
return nil |
2268
|
|
|
} |
2269
|
|
|
|
2270
|
|
|
var errors []error |
2271
|
|
|
|
2272
|
|
|
// no validation rules for SchemaVersion |
2273
|
|
|
|
2274
|
|
|
// no validation rules for SnapToken |
2275
|
|
|
|
2276
|
|
|
if m.GetDepth() < 3 { |
2277
|
|
|
err := PermissionEntityFilterRequestMetadataValidationError{ |
2278
|
|
|
field: "Depth", |
2279
|
|
|
reason: "value must be greater than or equal to 3", |
2280
|
|
|
} |
2281
|
|
|
if !all { |
2282
|
|
|
return err |
2283
|
|
|
} |
2284
|
|
|
errors = append(errors, err) |
2285
|
|
|
} |
2286
|
|
|
|
2287
|
|
|
if len(errors) > 0 { |
2288
|
|
|
return PermissionEntityFilterRequestMetadataMultiError(errors) |
2289
|
|
|
} |
2290
|
|
|
|
2291
|
|
|
return nil |
2292
|
|
|
} |
2293
|
|
|
|
2294
|
|
|
// PermissionEntityFilterRequestMetadataMultiError is an error wrapping |
2295
|
|
|
// multiple validation errors returned by |
2296
|
|
|
// PermissionEntityFilterRequestMetadata.ValidateAll() if the designated |
2297
|
|
|
// constraints aren't met. |
2298
|
|
|
type PermissionEntityFilterRequestMetadataMultiError []error |
2299
|
|
|
|
2300
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2301
|
|
|
func (m PermissionEntityFilterRequestMetadataMultiError) Error() string { |
2302
|
|
|
var msgs []string |
2303
|
|
|
for _, err := range m { |
2304
|
|
|
msgs = append(msgs, err.Error()) |
2305
|
|
|
} |
2306
|
|
|
return strings.Join(msgs, "; ") |
2307
|
|
|
} |
2308
|
|
|
|
2309
|
|
|
// AllErrors returns a list of validation violation errors. |
2310
|
|
|
func (m PermissionEntityFilterRequestMetadataMultiError) AllErrors() []error { return m } |
2311
|
|
|
|
2312
|
|
|
// PermissionEntityFilterRequestMetadataValidationError is the validation error |
2313
|
|
|
// returned by PermissionEntityFilterRequestMetadata.Validate if the |
2314
|
|
|
// designated constraints aren't met. |
2315
|
|
|
type PermissionEntityFilterRequestMetadataValidationError struct { |
2316
|
|
|
field string |
2317
|
|
|
reason string |
2318
|
|
|
cause error |
2319
|
|
|
key bool |
2320
|
|
|
} |
2321
|
|
|
|
2322
|
|
|
// Field function returns field value. |
2323
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Field() string { return e.field } |
2324
|
|
|
|
2325
|
|
|
// Reason function returns reason value. |
2326
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Reason() string { return e.reason } |
2327
|
|
|
|
2328
|
|
|
// Cause function returns cause value. |
2329
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Cause() error { return e.cause } |
2330
|
|
|
|
2331
|
|
|
// Key function returns key value. |
2332
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Key() bool { return e.key } |
2333
|
|
|
|
2334
|
|
|
// ErrorName returns error name. |
2335
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) ErrorName() string { |
2336
|
|
|
return "PermissionEntityFilterRequestMetadataValidationError" |
2337
|
|
|
} |
2338
|
|
|
|
2339
|
|
|
// Error satisfies the builtin error interface |
2340
|
|
|
func (e PermissionEntityFilterRequestMetadataValidationError) Error() string { |
2341
|
|
|
cause := "" |
2342
|
|
|
if e.cause != nil { |
2343
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2344
|
|
|
} |
2345
|
|
|
|
2346
|
|
|
key := "" |
2347
|
|
|
if e.key { |
2348
|
|
|
key = "key for " |
2349
|
|
|
} |
2350
|
|
|
|
2351
|
|
|
return fmt.Sprintf( |
2352
|
|
|
"invalid %sPermissionEntityFilterRequestMetadata.%s: %s%s", |
2353
|
|
|
key, |
2354
|
|
|
e.field, |
2355
|
|
|
e.reason, |
2356
|
|
|
cause) |
2357
|
|
|
} |
2358
|
|
|
|
2359
|
|
|
var _ error = PermissionEntityFilterRequestMetadataValidationError{} |
2360
|
|
|
|
2361
|
|
|
var _ interface { |
2362
|
|
|
Field() string |
2363
|
|
|
Reason() string |
2364
|
|
|
Key() bool |
2365
|
|
|
Cause() error |
2366
|
|
|
ErrorName() string |
2367
|
|
|
} = PermissionEntityFilterRequestMetadataValidationError{} |
2368
|
|
|
|
2369
|
|
|
// Validate checks the field values on PermissionLookupSubjectRequest with the |
2370
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2371
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2372
|
|
|
func (m *PermissionLookupSubjectRequest) Validate() error { |
2373
|
|
|
return m.validate(false) |
2374
|
|
|
} |
2375
|
|
|
|
2376
|
|
|
// ValidateAll checks the field values on PermissionLookupSubjectRequest with |
2377
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2378
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2379
|
|
|
// PermissionLookupSubjectRequestMultiError, or nil if none found. |
2380
|
|
|
func (m *PermissionLookupSubjectRequest) ValidateAll() error { |
2381
|
|
|
return m.validate(true) |
2382
|
|
|
} |
2383
|
|
|
|
2384
|
|
|
func (m *PermissionLookupSubjectRequest) validate(all bool) error { |
2385
|
|
|
if m == nil { |
2386
|
|
|
return nil |
2387
|
|
|
} |
2388
|
|
|
|
2389
|
|
|
var errors []error |
2390
|
|
|
|
2391
|
|
|
if len(m.GetTenantId()) > 128 { |
2392
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2393
|
|
|
field: "TenantId", |
2394
|
|
|
reason: "value length must be at most 128 bytes", |
2395
|
|
|
} |
2396
|
|
|
if !all { |
2397
|
|
|
return err |
2398
|
|
|
} |
2399
|
|
|
errors = append(errors, err) |
2400
|
|
|
} |
2401
|
|
|
|
2402
|
|
|
if !_PermissionLookupSubjectRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
2403
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2404
|
|
|
field: "TenantId", |
2405
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
2406
|
|
|
} |
2407
|
|
|
if !all { |
2408
|
|
|
return err |
2409
|
|
|
} |
2410
|
|
|
errors = append(errors, err) |
2411
|
|
|
} |
2412
|
|
|
|
2413
|
|
|
if m.GetMetadata() == nil { |
2414
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2415
|
|
|
field: "Metadata", |
2416
|
|
|
reason: "value is required", |
2417
|
|
|
} |
2418
|
|
|
if !all { |
2419
|
|
|
return err |
2420
|
|
|
} |
2421
|
|
|
errors = append(errors, err) |
2422
|
|
|
} |
2423
|
|
|
|
2424
|
|
|
if all { |
2425
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
2426
|
|
|
case interface{ ValidateAll() error }: |
2427
|
|
|
if err := v.ValidateAll(); err != nil { |
2428
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2429
|
|
|
field: "Metadata", |
2430
|
|
|
reason: "embedded message failed validation", |
2431
|
|
|
cause: err, |
2432
|
|
|
}) |
2433
|
|
|
} |
2434
|
|
|
case interface{ Validate() error }: |
2435
|
|
|
if err := v.Validate(); err != nil { |
2436
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2437
|
|
|
field: "Metadata", |
2438
|
|
|
reason: "embedded message failed validation", |
2439
|
|
|
cause: err, |
2440
|
|
|
}) |
2441
|
|
|
} |
2442
|
|
|
} |
2443
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
2444
|
|
|
if err := v.Validate(); err != nil { |
2445
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
2446
|
|
|
field: "Metadata", |
2447
|
|
|
reason: "embedded message failed validation", |
2448
|
|
|
cause: err, |
2449
|
|
|
} |
2450
|
|
|
} |
2451
|
|
|
} |
2452
|
|
|
|
2453
|
|
|
if m.GetEntity() == nil { |
2454
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2455
|
|
|
field: "Entity", |
2456
|
|
|
reason: "value is required", |
2457
|
|
|
} |
2458
|
|
|
if !all { |
2459
|
|
|
return err |
2460
|
|
|
} |
2461
|
|
|
errors = append(errors, err) |
2462
|
|
|
} |
2463
|
|
|
|
2464
|
|
|
if all { |
2465
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
2466
|
|
|
case interface{ ValidateAll() error }: |
2467
|
|
|
if err := v.ValidateAll(); err != nil { |
2468
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2469
|
|
|
field: "Entity", |
2470
|
|
|
reason: "embedded message failed validation", |
2471
|
|
|
cause: err, |
2472
|
|
|
}) |
2473
|
|
|
} |
2474
|
|
|
case interface{ Validate() error }: |
2475
|
|
|
if err := v.Validate(); err != nil { |
2476
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2477
|
|
|
field: "Entity", |
2478
|
|
|
reason: "embedded message failed validation", |
2479
|
|
|
cause: err, |
2480
|
|
|
}) |
2481
|
|
|
} |
2482
|
|
|
} |
2483
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
2484
|
|
|
if err := v.Validate(); err != nil { |
2485
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
2486
|
|
|
field: "Entity", |
2487
|
|
|
reason: "embedded message failed validation", |
2488
|
|
|
cause: err, |
2489
|
|
|
} |
2490
|
|
|
} |
2491
|
|
|
} |
2492
|
|
|
|
2493
|
|
|
if len(m.GetPermission()) > 64 { |
2494
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2495
|
|
|
field: "Permission", |
2496
|
|
|
reason: "value length must be at most 64 bytes", |
2497
|
|
|
} |
2498
|
|
|
if !all { |
2499
|
|
|
return err |
2500
|
|
|
} |
2501
|
|
|
errors = append(errors, err) |
2502
|
|
|
} |
2503
|
|
|
|
2504
|
|
|
if !_PermissionLookupSubjectRequest_Permission_Pattern.MatchString(m.GetPermission()) { |
2505
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2506
|
|
|
field: "Permission", |
2507
|
|
|
reason: "value does not match regex pattern \"^[a-zA-Z_]{1,64}$\"", |
2508
|
|
|
} |
2509
|
|
|
if !all { |
2510
|
|
|
return err |
2511
|
|
|
} |
2512
|
|
|
errors = append(errors, err) |
2513
|
|
|
} |
2514
|
|
|
|
2515
|
|
|
if m.GetSubjectReference() == nil { |
2516
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2517
|
|
|
field: "SubjectReference", |
2518
|
|
|
reason: "value is required", |
2519
|
|
|
} |
2520
|
|
|
if !all { |
2521
|
|
|
return err |
2522
|
|
|
} |
2523
|
|
|
errors = append(errors, err) |
2524
|
|
|
} |
2525
|
|
|
|
2526
|
|
|
if all { |
2527
|
|
|
switch v := interface{}(m.GetSubjectReference()).(type) { |
2528
|
|
|
case interface{ ValidateAll() error }: |
2529
|
|
|
if err := v.ValidateAll(); err != nil { |
2530
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2531
|
|
|
field: "SubjectReference", |
2532
|
|
|
reason: "embedded message failed validation", |
2533
|
|
|
cause: err, |
2534
|
|
|
}) |
2535
|
|
|
} |
2536
|
|
|
case interface{ Validate() error }: |
2537
|
|
|
if err := v.Validate(); err != nil { |
2538
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2539
|
|
|
field: "SubjectReference", |
2540
|
|
|
reason: "embedded message failed validation", |
2541
|
|
|
cause: err, |
2542
|
|
|
}) |
2543
|
|
|
} |
2544
|
|
|
} |
2545
|
|
|
} else if v, ok := interface{}(m.GetSubjectReference()).(interface{ Validate() error }); ok { |
2546
|
|
|
if err := v.Validate(); err != nil { |
2547
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
2548
|
|
|
field: "SubjectReference", |
2549
|
|
|
reason: "embedded message failed validation", |
2550
|
|
|
cause: err, |
2551
|
|
|
} |
2552
|
|
|
} |
2553
|
|
|
} |
2554
|
|
|
|
2555
|
|
|
if all { |
2556
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
2557
|
|
|
case interface{ ValidateAll() error }: |
2558
|
|
|
if err := v.ValidateAll(); err != nil { |
2559
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2560
|
|
|
field: "Context", |
2561
|
|
|
reason: "embedded message failed validation", |
2562
|
|
|
cause: err, |
2563
|
|
|
}) |
2564
|
|
|
} |
2565
|
|
|
case interface{ Validate() error }: |
2566
|
|
|
if err := v.Validate(); err != nil { |
2567
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2568
|
|
|
field: "Context", |
2569
|
|
|
reason: "embedded message failed validation", |
2570
|
|
|
cause: err, |
2571
|
|
|
}) |
2572
|
|
|
} |
2573
|
|
|
} |
2574
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
2575
|
|
|
if err := v.Validate(); err != nil { |
2576
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
2577
|
|
|
field: "Context", |
2578
|
|
|
reason: "embedded message failed validation", |
2579
|
|
|
cause: err, |
2580
|
|
|
} |
2581
|
|
|
} |
2582
|
|
|
} |
2583
|
|
|
|
2584
|
|
|
for idx, item := range m.GetArguments() { |
2585
|
|
|
_, _ = idx, item |
2586
|
|
|
|
2587
|
|
|
if all { |
2588
|
|
|
switch v := interface{}(item).(type) { |
2589
|
|
|
case interface{ ValidateAll() error }: |
2590
|
|
|
if err := v.ValidateAll(); err != nil { |
2591
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2592
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
2593
|
|
|
reason: "embedded message failed validation", |
2594
|
|
|
cause: err, |
2595
|
|
|
}) |
2596
|
|
|
} |
2597
|
|
|
case interface{ Validate() error }: |
2598
|
|
|
if err := v.Validate(); err != nil { |
2599
|
|
|
errors = append(errors, PermissionLookupSubjectRequestValidationError{ |
2600
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
2601
|
|
|
reason: "embedded message failed validation", |
2602
|
|
|
cause: err, |
2603
|
|
|
}) |
2604
|
|
|
} |
2605
|
|
|
} |
2606
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
2607
|
|
|
if err := v.Validate(); err != nil { |
2608
|
|
|
return PermissionLookupSubjectRequestValidationError{ |
2609
|
|
|
field: fmt.Sprintf("Arguments[%v]", idx), |
2610
|
|
|
reason: "embedded message failed validation", |
2611
|
|
|
cause: err, |
2612
|
|
|
} |
2613
|
|
|
} |
2614
|
|
|
} |
2615
|
|
|
|
2616
|
|
|
} |
2617
|
|
|
|
2618
|
|
|
if m.GetPageSize() != 0 { |
2619
|
|
|
|
2620
|
|
|
if m.GetPageSize() < 1 { |
2621
|
|
|
err := PermissionLookupSubjectRequestValidationError{ |
2622
|
|
|
field: "PageSize", |
2623
|
|
|
reason: "value must be greater than or equal to 1", |
2624
|
|
|
} |
2625
|
|
|
if !all { |
2626
|
|
|
return err |
2627
|
|
|
} |
2628
|
|
|
errors = append(errors, err) |
2629
|
|
|
} |
2630
|
|
|
|
2631
|
|
|
} |
2632
|
|
|
|
2633
|
|
|
if m.GetContinuousToken() != "" { |
2634
|
|
|
|
2635
|
|
|
} |
2636
|
|
|
|
2637
|
|
|
if len(errors) > 0 { |
2638
|
|
|
return PermissionLookupSubjectRequestMultiError(errors) |
2639
|
|
|
} |
2640
|
|
|
|
2641
|
|
|
return nil |
2642
|
|
|
} |
2643
|
|
|
|
2644
|
|
|
// PermissionLookupSubjectRequestMultiError is an error wrapping multiple |
2645
|
|
|
// validation errors returned by PermissionLookupSubjectRequest.ValidateAll() |
2646
|
|
|
// if the designated constraints aren't met. |
2647
|
|
|
type PermissionLookupSubjectRequestMultiError []error |
2648
|
|
|
|
2649
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2650
|
|
|
func (m PermissionLookupSubjectRequestMultiError) Error() string { |
2651
|
|
|
var msgs []string |
2652
|
|
|
for _, err := range m { |
2653
|
|
|
msgs = append(msgs, err.Error()) |
2654
|
|
|
} |
2655
|
|
|
return strings.Join(msgs, "; ") |
2656
|
|
|
} |
2657
|
|
|
|
2658
|
|
|
// AllErrors returns a list of validation violation errors. |
2659
|
|
|
func (m PermissionLookupSubjectRequestMultiError) AllErrors() []error { return m } |
2660
|
|
|
|
2661
|
|
|
// PermissionLookupSubjectRequestValidationError is the validation error |
2662
|
|
|
// returned by PermissionLookupSubjectRequest.Validate if the designated |
2663
|
|
|
// constraints aren't met. |
2664
|
|
|
type PermissionLookupSubjectRequestValidationError struct { |
2665
|
|
|
field string |
2666
|
|
|
reason string |
2667
|
|
|
cause error |
2668
|
|
|
key bool |
2669
|
|
|
} |
2670
|
|
|
|
2671
|
|
|
// Field function returns field value. |
2672
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Field() string { return e.field } |
2673
|
|
|
|
2674
|
|
|
// Reason function returns reason value. |
2675
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Reason() string { return e.reason } |
2676
|
|
|
|
2677
|
|
|
// Cause function returns cause value. |
2678
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Cause() error { return e.cause } |
2679
|
|
|
|
2680
|
|
|
// Key function returns key value. |
2681
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Key() bool { return e.key } |
2682
|
|
|
|
2683
|
|
|
// ErrorName returns error name. |
2684
|
|
|
func (e PermissionLookupSubjectRequestValidationError) ErrorName() string { |
2685
|
|
|
return "PermissionLookupSubjectRequestValidationError" |
2686
|
|
|
} |
2687
|
|
|
|
2688
|
|
|
// Error satisfies the builtin error interface |
2689
|
|
|
func (e PermissionLookupSubjectRequestValidationError) Error() string { |
2690
|
|
|
cause := "" |
2691
|
|
|
if e.cause != nil { |
2692
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2693
|
|
|
} |
2694
|
|
|
|
2695
|
|
|
key := "" |
2696
|
|
|
if e.key { |
2697
|
|
|
key = "key for " |
2698
|
|
|
} |
2699
|
|
|
|
2700
|
|
|
return fmt.Sprintf( |
2701
|
|
|
"invalid %sPermissionLookupSubjectRequest.%s: %s%s", |
2702
|
|
|
key, |
2703
|
|
|
e.field, |
2704
|
|
|
e.reason, |
2705
|
|
|
cause) |
2706
|
|
|
} |
2707
|
|
|
|
2708
|
|
|
var _ error = PermissionLookupSubjectRequestValidationError{} |
2709
|
|
|
|
2710
|
|
|
var _ interface { |
2711
|
|
|
Field() string |
2712
|
|
|
Reason() string |
2713
|
|
|
Key() bool |
2714
|
|
|
Cause() error |
2715
|
|
|
ErrorName() string |
2716
|
|
|
} = PermissionLookupSubjectRequestValidationError{} |
2717
|
|
|
|
2718
|
|
|
var _PermissionLookupSubjectRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
2719
|
|
|
|
2720
|
|
|
var _PermissionLookupSubjectRequest_Permission_Pattern = regexp.MustCompile("^[a-zA-Z_]{1,64}$") |
2721
|
|
|
|
2722
|
|
|
// Validate checks the field values on PermissionLookupSubjectRequestMetadata |
2723
|
|
|
// with the rules defined in the proto definition for this message. If any |
2724
|
|
|
// rules are violated, the first error encountered is returned, or nil if |
2725
|
|
|
// there are no violations. |
2726
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) Validate() error { |
2727
|
|
|
return m.validate(false) |
2728
|
|
|
} |
2729
|
|
|
|
2730
|
|
|
// ValidateAll checks the field values on |
2731
|
|
|
// PermissionLookupSubjectRequestMetadata with the rules defined in the proto |
2732
|
|
|
// definition for this message. If any rules are violated, the result is a |
2733
|
|
|
// list of violation errors wrapped in |
2734
|
|
|
// PermissionLookupSubjectRequestMetadataMultiError, or nil if none found. |
2735
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) ValidateAll() error { |
2736
|
|
|
return m.validate(true) |
2737
|
|
|
} |
2738
|
|
|
|
2739
|
|
|
func (m *PermissionLookupSubjectRequestMetadata) validate(all bool) error { |
2740
|
|
|
if m == nil { |
2741
|
|
|
return nil |
2742
|
|
|
} |
2743
|
|
|
|
2744
|
|
|
var errors []error |
2745
|
|
|
|
2746
|
|
|
// no validation rules for SchemaVersion |
2747
|
|
|
|
2748
|
|
|
// no validation rules for SnapToken |
2749
|
|
|
|
2750
|
|
|
if m.GetDepth() < 3 { |
2751
|
|
|
err := PermissionLookupSubjectRequestMetadataValidationError{ |
2752
|
|
|
field: "Depth", |
2753
|
|
|
reason: "value must be greater than or equal to 3", |
2754
|
|
|
} |
2755
|
|
|
if !all { |
2756
|
|
|
return err |
2757
|
|
|
} |
2758
|
|
|
errors = append(errors, err) |
2759
|
|
|
} |
2760
|
|
|
|
2761
|
|
|
if len(errors) > 0 { |
2762
|
|
|
return PermissionLookupSubjectRequestMetadataMultiError(errors) |
2763
|
|
|
} |
2764
|
|
|
|
2765
|
|
|
return nil |
2766
|
|
|
} |
2767
|
|
|
|
2768
|
|
|
// PermissionLookupSubjectRequestMetadataMultiError is an error wrapping |
2769
|
|
|
// multiple validation errors returned by |
2770
|
|
|
// PermissionLookupSubjectRequestMetadata.ValidateAll() if the designated |
2771
|
|
|
// constraints aren't met. |
2772
|
|
|
type PermissionLookupSubjectRequestMetadataMultiError []error |
2773
|
|
|
|
2774
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2775
|
|
|
func (m PermissionLookupSubjectRequestMetadataMultiError) Error() string { |
2776
|
|
|
var msgs []string |
2777
|
|
|
for _, err := range m { |
2778
|
|
|
msgs = append(msgs, err.Error()) |
2779
|
|
|
} |
2780
|
|
|
return strings.Join(msgs, "; ") |
2781
|
|
|
} |
2782
|
|
|
|
2783
|
|
|
// AllErrors returns a list of validation violation errors. |
2784
|
|
|
func (m PermissionLookupSubjectRequestMetadataMultiError) AllErrors() []error { return m } |
2785
|
|
|
|
2786
|
|
|
// PermissionLookupSubjectRequestMetadataValidationError is the validation |
2787
|
|
|
// error returned by PermissionLookupSubjectRequestMetadata.Validate if the |
2788
|
|
|
// designated constraints aren't met. |
2789
|
|
|
type PermissionLookupSubjectRequestMetadataValidationError struct { |
2790
|
|
|
field string |
2791
|
|
|
reason string |
2792
|
|
|
cause error |
2793
|
|
|
key bool |
2794
|
|
|
} |
2795
|
|
|
|
2796
|
|
|
// Field function returns field value. |
2797
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Field() string { return e.field } |
2798
|
|
|
|
2799
|
|
|
// Reason function returns reason value. |
2800
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Reason() string { return e.reason } |
2801
|
|
|
|
2802
|
|
|
// Cause function returns cause value. |
2803
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Cause() error { return e.cause } |
2804
|
|
|
|
2805
|
|
|
// Key function returns key value. |
2806
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Key() bool { return e.key } |
2807
|
|
|
|
2808
|
|
|
// ErrorName returns error name. |
2809
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) ErrorName() string { |
2810
|
|
|
return "PermissionLookupSubjectRequestMetadataValidationError" |
2811
|
|
|
} |
2812
|
|
|
|
2813
|
|
|
// Error satisfies the builtin error interface |
2814
|
|
|
func (e PermissionLookupSubjectRequestMetadataValidationError) Error() string { |
2815
|
|
|
cause := "" |
2816
|
|
|
if e.cause != nil { |
2817
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2818
|
|
|
} |
2819
|
|
|
|
2820
|
|
|
key := "" |
2821
|
|
|
if e.key { |
2822
|
|
|
key = "key for " |
2823
|
|
|
} |
2824
|
|
|
|
2825
|
|
|
return fmt.Sprintf( |
2826
|
|
|
"invalid %sPermissionLookupSubjectRequestMetadata.%s: %s%s", |
2827
|
|
|
key, |
2828
|
|
|
e.field, |
2829
|
|
|
e.reason, |
2830
|
|
|
cause) |
2831
|
|
|
} |
2832
|
|
|
|
2833
|
|
|
var _ error = PermissionLookupSubjectRequestMetadataValidationError{} |
2834
|
|
|
|
2835
|
|
|
var _ interface { |
2836
|
|
|
Field() string |
2837
|
|
|
Reason() string |
2838
|
|
|
Key() bool |
2839
|
|
|
Cause() error |
2840
|
|
|
ErrorName() string |
2841
|
|
|
} = PermissionLookupSubjectRequestMetadataValidationError{} |
2842
|
|
|
|
2843
|
|
|
// Validate checks the field values on PermissionLookupSubjectResponse with the |
2844
|
|
|
// rules defined in the proto definition for this message. If any rules are |
2845
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
2846
|
|
|
func (m *PermissionLookupSubjectResponse) Validate() error { |
2847
|
|
|
return m.validate(false) |
2848
|
|
|
} |
2849
|
|
|
|
2850
|
|
|
// ValidateAll checks the field values on PermissionLookupSubjectResponse with |
2851
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2852
|
|
|
// are violated, the result is a list of violation errors wrapped in |
2853
|
|
|
// PermissionLookupSubjectResponseMultiError, or nil if none found. |
2854
|
|
|
func (m *PermissionLookupSubjectResponse) ValidateAll() error { |
2855
|
|
|
return m.validate(true) |
2856
|
|
|
} |
2857
|
|
|
|
2858
|
|
|
func (m *PermissionLookupSubjectResponse) validate(all bool) error { |
2859
|
|
|
if m == nil { |
2860
|
|
|
return nil |
2861
|
|
|
} |
2862
|
|
|
|
2863
|
|
|
var errors []error |
2864
|
|
|
|
2865
|
|
|
// no validation rules for ContinuousToken |
2866
|
|
|
|
2867
|
|
|
if len(errors) > 0 { |
2868
|
|
|
return PermissionLookupSubjectResponseMultiError(errors) |
2869
|
|
|
} |
2870
|
|
|
|
2871
|
|
|
return nil |
2872
|
|
|
} |
2873
|
|
|
|
2874
|
|
|
// PermissionLookupSubjectResponseMultiError is an error wrapping multiple |
2875
|
|
|
// validation errors returned by PermissionLookupSubjectResponse.ValidateAll() |
2876
|
|
|
// if the designated constraints aren't met. |
2877
|
|
|
type PermissionLookupSubjectResponseMultiError []error |
2878
|
|
|
|
2879
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
2880
|
|
|
func (m PermissionLookupSubjectResponseMultiError) Error() string { |
2881
|
|
|
var msgs []string |
2882
|
|
|
for _, err := range m { |
2883
|
|
|
msgs = append(msgs, err.Error()) |
2884
|
|
|
} |
2885
|
|
|
return strings.Join(msgs, "; ") |
2886
|
|
|
} |
2887
|
|
|
|
2888
|
|
|
// AllErrors returns a list of validation violation errors. |
2889
|
|
|
func (m PermissionLookupSubjectResponseMultiError) AllErrors() []error { return m } |
2890
|
|
|
|
2891
|
|
|
// PermissionLookupSubjectResponseValidationError is the validation error |
2892
|
|
|
// returned by PermissionLookupSubjectResponse.Validate if the designated |
2893
|
|
|
// constraints aren't met. |
2894
|
|
|
type PermissionLookupSubjectResponseValidationError struct { |
2895
|
|
|
field string |
2896
|
|
|
reason string |
2897
|
|
|
cause error |
2898
|
|
|
key bool |
2899
|
|
|
} |
2900
|
|
|
|
2901
|
|
|
// Field function returns field value. |
2902
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Field() string { return e.field } |
2903
|
|
|
|
2904
|
|
|
// Reason function returns reason value. |
2905
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Reason() string { return e.reason } |
2906
|
|
|
|
2907
|
|
|
// Cause function returns cause value. |
2908
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Cause() error { return e.cause } |
2909
|
|
|
|
2910
|
|
|
// Key function returns key value. |
2911
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Key() bool { return e.key } |
2912
|
|
|
|
2913
|
|
|
// ErrorName returns error name. |
2914
|
|
|
func (e PermissionLookupSubjectResponseValidationError) ErrorName() string { |
2915
|
|
|
return "PermissionLookupSubjectResponseValidationError" |
2916
|
|
|
} |
2917
|
|
|
|
2918
|
|
|
// Error satisfies the builtin error interface |
2919
|
|
|
func (e PermissionLookupSubjectResponseValidationError) Error() string { |
2920
|
|
|
cause := "" |
2921
|
|
|
if e.cause != nil { |
2922
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
2923
|
|
|
} |
2924
|
|
|
|
2925
|
|
|
key := "" |
2926
|
|
|
if e.key { |
2927
|
|
|
key = "key for " |
2928
|
|
|
} |
2929
|
|
|
|
2930
|
|
|
return fmt.Sprintf( |
2931
|
|
|
"invalid %sPermissionLookupSubjectResponse.%s: %s%s", |
2932
|
|
|
key, |
2933
|
|
|
e.field, |
2934
|
|
|
e.reason, |
2935
|
|
|
cause) |
2936
|
|
|
} |
2937
|
|
|
|
2938
|
|
|
var _ error = PermissionLookupSubjectResponseValidationError{} |
2939
|
|
|
|
2940
|
|
|
var _ interface { |
2941
|
|
|
Field() string |
2942
|
|
|
Reason() string |
2943
|
|
|
Key() bool |
2944
|
|
|
Cause() error |
2945
|
|
|
ErrorName() string |
2946
|
|
|
} = PermissionLookupSubjectResponseValidationError{} |
2947
|
|
|
|
2948
|
|
|
// Validate checks the field values on PermissionSubjectPermissionRequest with |
2949
|
|
|
// the rules defined in the proto definition for this message. If any rules |
2950
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
2951
|
|
|
// no violations. |
2952
|
|
|
func (m *PermissionSubjectPermissionRequest) Validate() error { |
2953
|
|
|
return m.validate(false) |
2954
|
|
|
} |
2955
|
|
|
|
2956
|
|
|
// ValidateAll checks the field values on PermissionSubjectPermissionRequest |
2957
|
|
|
// with the rules defined in the proto definition for this message. If any |
2958
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
2959
|
|
|
// PermissionSubjectPermissionRequestMultiError, or nil if none found. |
2960
|
|
|
func (m *PermissionSubjectPermissionRequest) ValidateAll() error { |
2961
|
|
|
return m.validate(true) |
2962
|
|
|
} |
2963
|
|
|
|
2964
|
|
|
func (m *PermissionSubjectPermissionRequest) validate(all bool) error { |
2965
|
|
|
if m == nil { |
2966
|
|
|
return nil |
2967
|
|
|
} |
2968
|
|
|
|
2969
|
|
|
var errors []error |
2970
|
|
|
|
2971
|
|
|
if len(m.GetTenantId()) > 128 { |
2972
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
2973
|
|
|
field: "TenantId", |
2974
|
|
|
reason: "value length must be at most 128 bytes", |
2975
|
|
|
} |
2976
|
|
|
if !all { |
2977
|
|
|
return err |
2978
|
|
|
} |
2979
|
|
|
errors = append(errors, err) |
2980
|
|
|
} |
2981
|
|
|
|
2982
|
|
|
if !_PermissionSubjectPermissionRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
2983
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
2984
|
|
|
field: "TenantId", |
2985
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
2986
|
|
|
} |
2987
|
|
|
if !all { |
2988
|
|
|
return err |
2989
|
|
|
} |
2990
|
|
|
errors = append(errors, err) |
2991
|
|
|
} |
2992
|
|
|
|
2993
|
|
|
if m.GetMetadata() == nil { |
2994
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
2995
|
|
|
field: "Metadata", |
2996
|
|
|
reason: "value is required", |
2997
|
|
|
} |
2998
|
|
|
if !all { |
2999
|
|
|
return err |
3000
|
|
|
} |
3001
|
|
|
errors = append(errors, err) |
3002
|
|
|
} |
3003
|
|
|
|
3004
|
|
|
if all { |
3005
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
3006
|
|
|
case interface{ ValidateAll() error }: |
3007
|
|
|
if err := v.ValidateAll(); err != nil { |
3008
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3009
|
|
|
field: "Metadata", |
3010
|
|
|
reason: "embedded message failed validation", |
3011
|
|
|
cause: err, |
3012
|
|
|
}) |
3013
|
|
|
} |
3014
|
|
|
case interface{ Validate() error }: |
3015
|
|
|
if err := v.Validate(); err != nil { |
3016
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3017
|
|
|
field: "Metadata", |
3018
|
|
|
reason: "embedded message failed validation", |
3019
|
|
|
cause: err, |
3020
|
|
|
}) |
3021
|
|
|
} |
3022
|
|
|
} |
3023
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
3024
|
|
|
if err := v.Validate(); err != nil { |
3025
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3026
|
|
|
field: "Metadata", |
3027
|
|
|
reason: "embedded message failed validation", |
3028
|
|
|
cause: err, |
3029
|
|
|
} |
3030
|
|
|
} |
3031
|
|
|
} |
3032
|
|
|
|
3033
|
|
|
if m.GetEntity() == nil { |
3034
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3035
|
|
|
field: "Entity", |
3036
|
|
|
reason: "value is required", |
3037
|
|
|
} |
3038
|
|
|
if !all { |
3039
|
|
|
return err |
3040
|
|
|
} |
3041
|
|
|
errors = append(errors, err) |
3042
|
|
|
} |
3043
|
|
|
|
3044
|
|
|
if all { |
3045
|
|
|
switch v := interface{}(m.GetEntity()).(type) { |
3046
|
|
|
case interface{ ValidateAll() error }: |
3047
|
|
|
if err := v.ValidateAll(); err != nil { |
3048
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3049
|
|
|
field: "Entity", |
3050
|
|
|
reason: "embedded message failed validation", |
3051
|
|
|
cause: err, |
3052
|
|
|
}) |
3053
|
|
|
} |
3054
|
|
|
case interface{ Validate() error }: |
3055
|
|
|
if err := v.Validate(); err != nil { |
3056
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3057
|
|
|
field: "Entity", |
3058
|
|
|
reason: "embedded message failed validation", |
3059
|
|
|
cause: err, |
3060
|
|
|
}) |
3061
|
|
|
} |
3062
|
|
|
} |
3063
|
|
|
} else if v, ok := interface{}(m.GetEntity()).(interface{ Validate() error }); ok { |
3064
|
|
|
if err := v.Validate(); err != nil { |
3065
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3066
|
|
|
field: "Entity", |
3067
|
|
|
reason: "embedded message failed validation", |
3068
|
|
|
cause: err, |
3069
|
|
|
} |
3070
|
|
|
} |
3071
|
|
|
} |
3072
|
|
|
|
3073
|
|
|
if m.GetSubject() == nil { |
3074
|
|
|
err := PermissionSubjectPermissionRequestValidationError{ |
3075
|
|
|
field: "Subject", |
3076
|
|
|
reason: "value is required", |
3077
|
|
|
} |
3078
|
|
|
if !all { |
3079
|
|
|
return err |
3080
|
|
|
} |
3081
|
|
|
errors = append(errors, err) |
3082
|
|
|
} |
3083
|
|
|
|
3084
|
|
|
if all { |
3085
|
|
|
switch v := interface{}(m.GetSubject()).(type) { |
3086
|
|
|
case interface{ ValidateAll() error }: |
3087
|
|
|
if err := v.ValidateAll(); err != nil { |
3088
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3089
|
|
|
field: "Subject", |
3090
|
|
|
reason: "embedded message failed validation", |
3091
|
|
|
cause: err, |
3092
|
|
|
}) |
3093
|
|
|
} |
3094
|
|
|
case interface{ Validate() error }: |
3095
|
|
|
if err := v.Validate(); err != nil { |
3096
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3097
|
|
|
field: "Subject", |
3098
|
|
|
reason: "embedded message failed validation", |
3099
|
|
|
cause: err, |
3100
|
|
|
}) |
3101
|
|
|
} |
3102
|
|
|
} |
3103
|
|
|
} else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { |
3104
|
|
|
if err := v.Validate(); err != nil { |
3105
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3106
|
|
|
field: "Subject", |
3107
|
|
|
reason: "embedded message failed validation", |
3108
|
|
|
cause: err, |
3109
|
|
|
} |
3110
|
|
|
} |
3111
|
|
|
} |
3112
|
|
|
|
3113
|
|
|
if all { |
3114
|
|
|
switch v := interface{}(m.GetContext()).(type) { |
3115
|
|
|
case interface{ ValidateAll() error }: |
3116
|
|
|
if err := v.ValidateAll(); err != nil { |
3117
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3118
|
|
|
field: "Context", |
3119
|
|
|
reason: "embedded message failed validation", |
3120
|
|
|
cause: err, |
3121
|
|
|
}) |
3122
|
|
|
} |
3123
|
|
|
case interface{ Validate() error }: |
3124
|
|
|
if err := v.Validate(); err != nil { |
3125
|
|
|
errors = append(errors, PermissionSubjectPermissionRequestValidationError{ |
3126
|
|
|
field: "Context", |
3127
|
|
|
reason: "embedded message failed validation", |
3128
|
|
|
cause: err, |
3129
|
|
|
}) |
3130
|
|
|
} |
3131
|
|
|
} |
3132
|
|
|
} else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { |
3133
|
|
|
if err := v.Validate(); err != nil { |
3134
|
|
|
return PermissionSubjectPermissionRequestValidationError{ |
3135
|
|
|
field: "Context", |
3136
|
|
|
reason: "embedded message failed validation", |
3137
|
|
|
cause: err, |
3138
|
|
|
} |
3139
|
|
|
} |
3140
|
|
|
} |
3141
|
|
|
|
3142
|
|
|
if len(errors) > 0 { |
3143
|
|
|
return PermissionSubjectPermissionRequestMultiError(errors) |
3144
|
|
|
} |
3145
|
|
|
|
3146
|
|
|
return nil |
3147
|
|
|
} |
3148
|
|
|
|
3149
|
|
|
// PermissionSubjectPermissionRequestMultiError is an error wrapping multiple |
3150
|
|
|
// validation errors returned by |
3151
|
|
|
// PermissionSubjectPermissionRequest.ValidateAll() if the designated |
3152
|
|
|
// constraints aren't met. |
3153
|
|
|
type PermissionSubjectPermissionRequestMultiError []error |
3154
|
|
|
|
3155
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3156
|
|
|
func (m PermissionSubjectPermissionRequestMultiError) Error() string { |
3157
|
|
|
var msgs []string |
3158
|
|
|
for _, err := range m { |
3159
|
|
|
msgs = append(msgs, err.Error()) |
3160
|
|
|
} |
3161
|
|
|
return strings.Join(msgs, "; ") |
3162
|
|
|
} |
3163
|
|
|
|
3164
|
|
|
// AllErrors returns a list of validation violation errors. |
3165
|
|
|
func (m PermissionSubjectPermissionRequestMultiError) AllErrors() []error { return m } |
3166
|
|
|
|
3167
|
|
|
// PermissionSubjectPermissionRequestValidationError is the validation error |
3168
|
|
|
// returned by PermissionSubjectPermissionRequest.Validate if the designated |
3169
|
|
|
// constraints aren't met. |
3170
|
|
|
type PermissionSubjectPermissionRequestValidationError struct { |
3171
|
|
|
field string |
3172
|
|
|
reason string |
3173
|
|
|
cause error |
3174
|
|
|
key bool |
3175
|
|
|
} |
3176
|
|
|
|
3177
|
|
|
// Field function returns field value. |
3178
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Field() string { return e.field } |
3179
|
|
|
|
3180
|
|
|
// Reason function returns reason value. |
3181
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Reason() string { return e.reason } |
3182
|
|
|
|
3183
|
|
|
// Cause function returns cause value. |
3184
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Cause() error { return e.cause } |
3185
|
|
|
|
3186
|
|
|
// Key function returns key value. |
3187
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Key() bool { return e.key } |
3188
|
|
|
|
3189
|
|
|
// ErrorName returns error name. |
3190
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) ErrorName() string { |
3191
|
|
|
return "PermissionSubjectPermissionRequestValidationError" |
3192
|
|
|
} |
3193
|
|
|
|
3194
|
|
|
// Error satisfies the builtin error interface |
3195
|
|
|
func (e PermissionSubjectPermissionRequestValidationError) Error() string { |
3196
|
|
|
cause := "" |
3197
|
|
|
if e.cause != nil { |
3198
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3199
|
|
|
} |
3200
|
|
|
|
3201
|
|
|
key := "" |
3202
|
|
|
if e.key { |
3203
|
|
|
key = "key for " |
3204
|
|
|
} |
3205
|
|
|
|
3206
|
|
|
return fmt.Sprintf( |
3207
|
|
|
"invalid %sPermissionSubjectPermissionRequest.%s: %s%s", |
3208
|
|
|
key, |
3209
|
|
|
e.field, |
3210
|
|
|
e.reason, |
3211
|
|
|
cause) |
3212
|
|
|
} |
3213
|
|
|
|
3214
|
|
|
var _ error = PermissionSubjectPermissionRequestValidationError{} |
3215
|
|
|
|
3216
|
|
|
var _ interface { |
3217
|
|
|
Field() string |
3218
|
|
|
Reason() string |
3219
|
|
|
Key() bool |
3220
|
|
|
Cause() error |
3221
|
|
|
ErrorName() string |
3222
|
|
|
} = PermissionSubjectPermissionRequestValidationError{} |
3223
|
|
|
|
3224
|
|
|
var _PermissionSubjectPermissionRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3225
|
|
|
|
3226
|
|
|
// Validate checks the field values on |
3227
|
|
|
// PermissionSubjectPermissionRequestMetadata with the rules defined in the |
3228
|
|
|
// proto definition for this message. If any rules are violated, the first |
3229
|
|
|
// error encountered is returned, or nil if there are no violations. |
3230
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) Validate() error { |
3231
|
|
|
return m.validate(false) |
3232
|
|
|
} |
3233
|
|
|
|
3234
|
|
|
// ValidateAll checks the field values on |
3235
|
|
|
// PermissionSubjectPermissionRequestMetadata with the rules defined in the |
3236
|
|
|
// proto definition for this message. If any rules are violated, the result is |
3237
|
|
|
// a list of violation errors wrapped in |
3238
|
|
|
// PermissionSubjectPermissionRequestMetadataMultiError, or nil if none found. |
3239
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) ValidateAll() error { |
3240
|
|
|
return m.validate(true) |
3241
|
|
|
} |
3242
|
|
|
|
3243
|
|
|
func (m *PermissionSubjectPermissionRequestMetadata) validate(all bool) error { |
3244
|
|
|
if m == nil { |
3245
|
|
|
return nil |
3246
|
|
|
} |
3247
|
|
|
|
3248
|
|
|
var errors []error |
3249
|
|
|
|
3250
|
|
|
// no validation rules for SchemaVersion |
3251
|
|
|
|
3252
|
|
|
// no validation rules for SnapToken |
3253
|
|
|
|
3254
|
|
|
// no validation rules for OnlyPermission |
3255
|
|
|
|
3256
|
|
|
if m.GetDepth() < 3 { |
3257
|
|
|
err := PermissionSubjectPermissionRequestMetadataValidationError{ |
3258
|
|
|
field: "Depth", |
3259
|
|
|
reason: "value must be greater than or equal to 3", |
3260
|
|
|
} |
3261
|
|
|
if !all { |
3262
|
|
|
return err |
3263
|
|
|
} |
3264
|
|
|
errors = append(errors, err) |
3265
|
|
|
} |
3266
|
|
|
|
3267
|
|
|
if len(errors) > 0 { |
3268
|
|
|
return PermissionSubjectPermissionRequestMetadataMultiError(errors) |
3269
|
|
|
} |
3270
|
|
|
|
3271
|
|
|
return nil |
3272
|
|
|
} |
3273
|
|
|
|
3274
|
|
|
// PermissionSubjectPermissionRequestMetadataMultiError is an error wrapping |
3275
|
|
|
// multiple validation errors returned by |
3276
|
|
|
// PermissionSubjectPermissionRequestMetadata.ValidateAll() if the designated |
3277
|
|
|
// constraints aren't met. |
3278
|
|
|
type PermissionSubjectPermissionRequestMetadataMultiError []error |
3279
|
|
|
|
3280
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3281
|
|
|
func (m PermissionSubjectPermissionRequestMetadataMultiError) Error() string { |
3282
|
|
|
var msgs []string |
3283
|
|
|
for _, err := range m { |
3284
|
|
|
msgs = append(msgs, err.Error()) |
3285
|
|
|
} |
3286
|
|
|
return strings.Join(msgs, "; ") |
3287
|
|
|
} |
3288
|
|
|
|
3289
|
|
|
// AllErrors returns a list of validation violation errors. |
3290
|
|
|
func (m PermissionSubjectPermissionRequestMetadataMultiError) AllErrors() []error { return m } |
3291
|
|
|
|
3292
|
|
|
// PermissionSubjectPermissionRequestMetadataValidationError is the validation |
3293
|
|
|
// error returned by PermissionSubjectPermissionRequestMetadata.Validate if |
3294
|
|
|
// the designated constraints aren't met. |
3295
|
|
|
type PermissionSubjectPermissionRequestMetadataValidationError struct { |
3296
|
|
|
field string |
3297
|
|
|
reason string |
3298
|
|
|
cause error |
3299
|
|
|
key bool |
3300
|
|
|
} |
3301
|
|
|
|
3302
|
|
|
// Field function returns field value. |
3303
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Field() string { return e.field } |
3304
|
|
|
|
3305
|
|
|
// Reason function returns reason value. |
3306
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Reason() string { return e.reason } |
3307
|
|
|
|
3308
|
|
|
// Cause function returns cause value. |
3309
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Cause() error { return e.cause } |
3310
|
|
|
|
3311
|
|
|
// Key function returns key value. |
3312
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Key() bool { return e.key } |
3313
|
|
|
|
3314
|
|
|
// ErrorName returns error name. |
3315
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) ErrorName() string { |
3316
|
|
|
return "PermissionSubjectPermissionRequestMetadataValidationError" |
3317
|
|
|
} |
3318
|
|
|
|
3319
|
|
|
// Error satisfies the builtin error interface |
3320
|
|
|
func (e PermissionSubjectPermissionRequestMetadataValidationError) Error() string { |
3321
|
|
|
cause := "" |
3322
|
|
|
if e.cause != nil { |
3323
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3324
|
|
|
} |
3325
|
|
|
|
3326
|
|
|
key := "" |
3327
|
|
|
if e.key { |
3328
|
|
|
key = "key for " |
3329
|
|
|
} |
3330
|
|
|
|
3331
|
|
|
return fmt.Sprintf( |
3332
|
|
|
"invalid %sPermissionSubjectPermissionRequestMetadata.%s: %s%s", |
3333
|
|
|
key, |
3334
|
|
|
e.field, |
3335
|
|
|
e.reason, |
3336
|
|
|
cause) |
3337
|
|
|
} |
3338
|
|
|
|
3339
|
|
|
var _ error = PermissionSubjectPermissionRequestMetadataValidationError{} |
3340
|
|
|
|
3341
|
|
|
var _ interface { |
3342
|
|
|
Field() string |
3343
|
|
|
Reason() string |
3344
|
|
|
Key() bool |
3345
|
|
|
Cause() error |
3346
|
|
|
ErrorName() string |
3347
|
|
|
} = PermissionSubjectPermissionRequestMetadataValidationError{} |
3348
|
|
|
|
3349
|
|
|
// Validate checks the field values on PermissionSubjectPermissionResponse with |
3350
|
|
|
// the rules defined in the proto definition for this message. If any rules |
3351
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
3352
|
|
|
// no violations. |
3353
|
|
|
func (m *PermissionSubjectPermissionResponse) Validate() error { |
3354
|
|
|
return m.validate(false) |
3355
|
|
|
} |
3356
|
|
|
|
3357
|
|
|
// ValidateAll checks the field values on PermissionSubjectPermissionResponse |
3358
|
|
|
// with the rules defined in the proto definition for this message. If any |
3359
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
3360
|
|
|
// PermissionSubjectPermissionResponseMultiError, or nil if none found. |
3361
|
|
|
func (m *PermissionSubjectPermissionResponse) ValidateAll() error { |
3362
|
|
|
return m.validate(true) |
3363
|
|
|
} |
3364
|
|
|
|
3365
|
|
|
func (m *PermissionSubjectPermissionResponse) validate(all bool) error { |
3366
|
|
|
if m == nil { |
3367
|
|
|
return nil |
3368
|
|
|
} |
3369
|
|
|
|
3370
|
|
|
var errors []error |
3371
|
|
|
|
3372
|
|
|
// no validation rules for Results |
3373
|
|
|
|
3374
|
|
|
if len(errors) > 0 { |
3375
|
|
|
return PermissionSubjectPermissionResponseMultiError(errors) |
3376
|
|
|
} |
3377
|
|
|
|
3378
|
|
|
return nil |
3379
|
|
|
} |
3380
|
|
|
|
3381
|
|
|
// PermissionSubjectPermissionResponseMultiError is an error wrapping multiple |
3382
|
|
|
// validation errors returned by |
3383
|
|
|
// PermissionSubjectPermissionResponse.ValidateAll() if the designated |
3384
|
|
|
// constraints aren't met. |
3385
|
|
|
type PermissionSubjectPermissionResponseMultiError []error |
3386
|
|
|
|
3387
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3388
|
|
|
func (m PermissionSubjectPermissionResponseMultiError) Error() string { |
3389
|
|
|
var msgs []string |
3390
|
|
|
for _, err := range m { |
3391
|
|
|
msgs = append(msgs, err.Error()) |
3392
|
|
|
} |
3393
|
|
|
return strings.Join(msgs, "; ") |
3394
|
|
|
} |
3395
|
|
|
|
3396
|
|
|
// AllErrors returns a list of validation violation errors. |
3397
|
|
|
func (m PermissionSubjectPermissionResponseMultiError) AllErrors() []error { return m } |
3398
|
|
|
|
3399
|
|
|
// PermissionSubjectPermissionResponseValidationError is the validation error |
3400
|
|
|
// returned by PermissionSubjectPermissionResponse.Validate if the designated |
3401
|
|
|
// constraints aren't met. |
3402
|
|
|
type PermissionSubjectPermissionResponseValidationError struct { |
3403
|
|
|
field string |
3404
|
|
|
reason string |
3405
|
|
|
cause error |
3406
|
|
|
key bool |
3407
|
|
|
} |
3408
|
|
|
|
3409
|
|
|
// Field function returns field value. |
3410
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Field() string { return e.field } |
3411
|
|
|
|
3412
|
|
|
// Reason function returns reason value. |
3413
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Reason() string { return e.reason } |
3414
|
|
|
|
3415
|
|
|
// Cause function returns cause value. |
3416
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Cause() error { return e.cause } |
3417
|
|
|
|
3418
|
|
|
// Key function returns key value. |
3419
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Key() bool { return e.key } |
3420
|
|
|
|
3421
|
|
|
// ErrorName returns error name. |
3422
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) ErrorName() string { |
3423
|
|
|
return "PermissionSubjectPermissionResponseValidationError" |
3424
|
|
|
} |
3425
|
|
|
|
3426
|
|
|
// Error satisfies the builtin error interface |
3427
|
|
|
func (e PermissionSubjectPermissionResponseValidationError) Error() string { |
3428
|
|
|
cause := "" |
3429
|
|
|
if e.cause != nil { |
3430
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3431
|
|
|
} |
3432
|
|
|
|
3433
|
|
|
key := "" |
3434
|
|
|
if e.key { |
3435
|
|
|
key = "key for " |
3436
|
|
|
} |
3437
|
|
|
|
3438
|
|
|
return fmt.Sprintf( |
3439
|
|
|
"invalid %sPermissionSubjectPermissionResponse.%s: %s%s", |
3440
|
|
|
key, |
3441
|
|
|
e.field, |
3442
|
|
|
e.reason, |
3443
|
|
|
cause) |
3444
|
|
|
} |
3445
|
|
|
|
3446
|
|
|
var _ error = PermissionSubjectPermissionResponseValidationError{} |
3447
|
|
|
|
3448
|
|
|
var _ interface { |
3449
|
|
|
Field() string |
3450
|
|
|
Reason() string |
3451
|
|
|
Key() bool |
3452
|
|
|
Cause() error |
3453
|
|
|
ErrorName() string |
3454
|
|
|
} = PermissionSubjectPermissionResponseValidationError{} |
3455
|
|
|
|
3456
|
|
|
// Validate checks the field values on WatchRequest with the rules defined in |
3457
|
|
|
// the proto definition for this message. If any rules are violated, the first |
3458
|
|
|
// error encountered is returned, or nil if there are no violations. |
3459
|
|
|
func (m *WatchRequest) Validate() error { |
3460
|
|
|
return m.validate(false) |
3461
|
|
|
} |
3462
|
|
|
|
3463
|
|
|
// ValidateAll checks the field values on WatchRequest with the rules defined |
3464
|
|
|
// in the proto definition for this message. If any rules are violated, the |
3465
|
|
|
// result is a list of violation errors wrapped in WatchRequestMultiError, or |
3466
|
|
|
// nil if none found. |
3467
|
|
|
func (m *WatchRequest) ValidateAll() error { |
3468
|
|
|
return m.validate(true) |
3469
|
|
|
} |
3470
|
|
|
|
3471
|
|
|
func (m *WatchRequest) validate(all bool) error { |
3472
|
|
|
if m == nil { |
3473
|
|
|
return nil |
3474
|
|
|
} |
3475
|
|
|
|
3476
|
|
|
var errors []error |
3477
|
|
|
|
3478
|
|
|
if len(m.GetTenantId()) > 128 { |
3479
|
|
|
err := WatchRequestValidationError{ |
3480
|
|
|
field: "TenantId", |
3481
|
|
|
reason: "value length must be at most 128 bytes", |
3482
|
|
|
} |
3483
|
|
|
if !all { |
3484
|
|
|
return err |
3485
|
|
|
} |
3486
|
|
|
errors = append(errors, err) |
3487
|
|
|
} |
3488
|
|
|
|
3489
|
|
|
if !_WatchRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3490
|
|
|
err := WatchRequestValidationError{ |
3491
|
|
|
field: "TenantId", |
3492
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3493
|
|
|
} |
3494
|
|
|
if !all { |
3495
|
|
|
return err |
3496
|
|
|
} |
3497
|
|
|
errors = append(errors, err) |
3498
|
|
|
} |
3499
|
|
|
|
3500
|
|
|
// no validation rules for SnapToken |
3501
|
|
|
|
3502
|
|
|
if len(errors) > 0 { |
3503
|
|
|
return WatchRequestMultiError(errors) |
3504
|
|
|
} |
3505
|
|
|
|
3506
|
|
|
return nil |
3507
|
|
|
} |
3508
|
|
|
|
3509
|
|
|
// WatchRequestMultiError is an error wrapping multiple validation errors |
3510
|
|
|
// returned by WatchRequest.ValidateAll() if the designated constraints aren't met. |
3511
|
|
|
type WatchRequestMultiError []error |
3512
|
|
|
|
3513
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3514
|
|
|
func (m WatchRequestMultiError) Error() string { |
3515
|
|
|
var msgs []string |
3516
|
|
|
for _, err := range m { |
3517
|
|
|
msgs = append(msgs, err.Error()) |
3518
|
|
|
} |
3519
|
|
|
return strings.Join(msgs, "; ") |
3520
|
|
|
} |
3521
|
|
|
|
3522
|
|
|
// AllErrors returns a list of validation violation errors. |
3523
|
|
|
func (m WatchRequestMultiError) AllErrors() []error { return m } |
3524
|
|
|
|
3525
|
|
|
// WatchRequestValidationError is the validation error returned by |
3526
|
|
|
// WatchRequest.Validate if the designated constraints aren't met. |
3527
|
|
|
type WatchRequestValidationError struct { |
3528
|
|
|
field string |
3529
|
|
|
reason string |
3530
|
|
|
cause error |
3531
|
|
|
key bool |
3532
|
|
|
} |
3533
|
|
|
|
3534
|
|
|
// Field function returns field value. |
3535
|
|
|
func (e WatchRequestValidationError) Field() string { return e.field } |
3536
|
|
|
|
3537
|
|
|
// Reason function returns reason value. |
3538
|
|
|
func (e WatchRequestValidationError) Reason() string { return e.reason } |
3539
|
|
|
|
3540
|
|
|
// Cause function returns cause value. |
3541
|
|
|
func (e WatchRequestValidationError) Cause() error { return e.cause } |
3542
|
|
|
|
3543
|
|
|
// Key function returns key value. |
3544
|
|
|
func (e WatchRequestValidationError) Key() bool { return e.key } |
3545
|
|
|
|
3546
|
|
|
// ErrorName returns error name. |
3547
|
|
|
func (e WatchRequestValidationError) ErrorName() string { return "WatchRequestValidationError" } |
3548
|
|
|
|
3549
|
|
|
// Error satisfies the builtin error interface |
3550
|
|
|
func (e WatchRequestValidationError) Error() string { |
3551
|
|
|
cause := "" |
3552
|
|
|
if e.cause != nil { |
3553
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3554
|
|
|
} |
3555
|
|
|
|
3556
|
|
|
key := "" |
3557
|
|
|
if e.key { |
3558
|
|
|
key = "key for " |
3559
|
|
|
} |
3560
|
|
|
|
3561
|
|
|
return fmt.Sprintf( |
3562
|
|
|
"invalid %sWatchRequest.%s: %s%s", |
3563
|
|
|
key, |
3564
|
|
|
e.field, |
3565
|
|
|
e.reason, |
3566
|
|
|
cause) |
3567
|
|
|
} |
3568
|
|
|
|
3569
|
|
|
var _ error = WatchRequestValidationError{} |
3570
|
|
|
|
3571
|
|
|
var _ interface { |
3572
|
|
|
Field() string |
3573
|
|
|
Reason() string |
3574
|
|
|
Key() bool |
3575
|
|
|
Cause() error |
3576
|
|
|
ErrorName() string |
3577
|
|
|
} = WatchRequestValidationError{} |
3578
|
|
|
|
3579
|
|
|
var _WatchRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3580
|
|
|
|
3581
|
|
|
// Validate checks the field values on WatchResponse with the rules defined in |
3582
|
|
|
// the proto definition for this message. If any rules are violated, the first |
3583
|
|
|
// error encountered is returned, or nil if there are no violations. |
3584
|
|
|
func (m *WatchResponse) Validate() error { |
3585
|
|
|
return m.validate(false) |
3586
|
|
|
} |
3587
|
|
|
|
3588
|
|
|
// ValidateAll checks the field values on WatchResponse with the rules defined |
3589
|
|
|
// in the proto definition for this message. If any rules are violated, the |
3590
|
|
|
// result is a list of violation errors wrapped in WatchResponseMultiError, or |
3591
|
|
|
// nil if none found. |
3592
|
|
|
func (m *WatchResponse) ValidateAll() error { |
3593
|
|
|
return m.validate(true) |
3594
|
|
|
} |
3595
|
|
|
|
3596
|
|
|
func (m *WatchResponse) validate(all bool) error { |
3597
|
|
|
if m == nil { |
3598
|
|
|
return nil |
3599
|
|
|
} |
3600
|
|
|
|
3601
|
|
|
var errors []error |
3602
|
|
|
|
3603
|
|
|
if all { |
3604
|
|
|
switch v := interface{}(m.GetChanges()).(type) { |
3605
|
|
|
case interface{ ValidateAll() error }: |
3606
|
|
|
if err := v.ValidateAll(); err != nil { |
3607
|
|
|
errors = append(errors, WatchResponseValidationError{ |
3608
|
|
|
field: "Changes", |
3609
|
|
|
reason: "embedded message failed validation", |
3610
|
|
|
cause: err, |
3611
|
|
|
}) |
3612
|
|
|
} |
3613
|
|
|
case interface{ Validate() error }: |
3614
|
|
|
if err := v.Validate(); err != nil { |
3615
|
|
|
errors = append(errors, WatchResponseValidationError{ |
3616
|
|
|
field: "Changes", |
3617
|
|
|
reason: "embedded message failed validation", |
3618
|
|
|
cause: err, |
3619
|
|
|
}) |
3620
|
|
|
} |
3621
|
|
|
} |
3622
|
|
|
} else if v, ok := interface{}(m.GetChanges()).(interface{ Validate() error }); ok { |
3623
|
|
|
if err := v.Validate(); err != nil { |
3624
|
|
|
return WatchResponseValidationError{ |
3625
|
|
|
field: "Changes", |
3626
|
|
|
reason: "embedded message failed validation", |
3627
|
|
|
cause: err, |
3628
|
|
|
} |
3629
|
|
|
} |
3630
|
|
|
} |
3631
|
|
|
|
3632
|
|
|
if len(errors) > 0 { |
3633
|
|
|
return WatchResponseMultiError(errors) |
3634
|
|
|
} |
3635
|
|
|
|
3636
|
|
|
return nil |
3637
|
|
|
} |
3638
|
|
|
|
3639
|
|
|
// WatchResponseMultiError is an error wrapping multiple validation errors |
3640
|
|
|
// returned by WatchResponse.ValidateAll() if the designated constraints |
3641
|
|
|
// aren't met. |
3642
|
|
|
type WatchResponseMultiError []error |
3643
|
|
|
|
3644
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3645
|
|
|
func (m WatchResponseMultiError) Error() string { |
3646
|
|
|
var msgs []string |
3647
|
|
|
for _, err := range m { |
3648
|
|
|
msgs = append(msgs, err.Error()) |
3649
|
|
|
} |
3650
|
|
|
return strings.Join(msgs, "; ") |
3651
|
|
|
} |
3652
|
|
|
|
3653
|
|
|
// AllErrors returns a list of validation violation errors. |
3654
|
|
|
func (m WatchResponseMultiError) AllErrors() []error { return m } |
3655
|
|
|
|
3656
|
|
|
// WatchResponseValidationError is the validation error returned by |
3657
|
|
|
// WatchResponse.Validate if the designated constraints aren't met. |
3658
|
|
|
type WatchResponseValidationError struct { |
3659
|
|
|
field string |
3660
|
|
|
reason string |
3661
|
|
|
cause error |
3662
|
|
|
key bool |
3663
|
|
|
} |
3664
|
|
|
|
3665
|
|
|
// Field function returns field value. |
3666
|
|
|
func (e WatchResponseValidationError) Field() string { return e.field } |
3667
|
|
|
|
3668
|
|
|
// Reason function returns reason value. |
3669
|
|
|
func (e WatchResponseValidationError) Reason() string { return e.reason } |
3670
|
|
|
|
3671
|
|
|
// Cause function returns cause value. |
3672
|
|
|
func (e WatchResponseValidationError) Cause() error { return e.cause } |
3673
|
|
|
|
3674
|
|
|
// Key function returns key value. |
3675
|
|
|
func (e WatchResponseValidationError) Key() bool { return e.key } |
3676
|
|
|
|
3677
|
|
|
// ErrorName returns error name. |
3678
|
|
|
func (e WatchResponseValidationError) ErrorName() string { return "WatchResponseValidationError" } |
3679
|
|
|
|
3680
|
|
|
// Error satisfies the builtin error interface |
3681
|
|
|
func (e WatchResponseValidationError) Error() string { |
3682
|
|
|
cause := "" |
3683
|
|
|
if e.cause != nil { |
3684
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3685
|
|
|
} |
3686
|
|
|
|
3687
|
|
|
key := "" |
3688
|
|
|
if e.key { |
3689
|
|
|
key = "key for " |
3690
|
|
|
} |
3691
|
|
|
|
3692
|
|
|
return fmt.Sprintf( |
3693
|
|
|
"invalid %sWatchResponse.%s: %s%s", |
3694
|
|
|
key, |
3695
|
|
|
e.field, |
3696
|
|
|
e.reason, |
3697
|
|
|
cause) |
3698
|
|
|
} |
3699
|
|
|
|
3700
|
|
|
var _ error = WatchResponseValidationError{} |
3701
|
|
|
|
3702
|
|
|
var _ interface { |
3703
|
|
|
Field() string |
3704
|
|
|
Reason() string |
3705
|
|
|
Key() bool |
3706
|
|
|
Cause() error |
3707
|
|
|
ErrorName() string |
3708
|
|
|
} = WatchResponseValidationError{} |
3709
|
|
|
|
3710
|
|
|
// Validate checks the field values on SchemaWriteRequest with the rules |
3711
|
|
|
// defined in the proto definition for this message. If any rules are |
3712
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3713
|
|
|
func (m *SchemaWriteRequest) Validate() error { |
3714
|
|
|
return m.validate(false) |
3715
|
|
|
} |
3716
|
|
|
|
3717
|
|
|
// ValidateAll checks the field values on SchemaWriteRequest with the rules |
3718
|
|
|
// defined in the proto definition for this message. If any rules are |
3719
|
|
|
// violated, the result is a list of violation errors wrapped in |
3720
|
|
|
// SchemaWriteRequestMultiError, or nil if none found. |
3721
|
|
|
func (m *SchemaWriteRequest) ValidateAll() error { |
3722
|
|
|
return m.validate(true) |
3723
|
|
|
} |
3724
|
|
|
|
3725
|
|
|
func (m *SchemaWriteRequest) validate(all bool) error { |
3726
|
|
|
if m == nil { |
3727
|
|
|
return nil |
3728
|
|
|
} |
3729
|
|
|
|
3730
|
|
|
var errors []error |
3731
|
|
|
|
3732
|
|
|
if len(m.GetTenantId()) > 128 { |
3733
|
|
|
err := SchemaWriteRequestValidationError{ |
3734
|
|
|
field: "TenantId", |
3735
|
|
|
reason: "value length must be at most 128 bytes", |
3736
|
|
|
} |
3737
|
|
|
if !all { |
3738
|
|
|
return err |
3739
|
|
|
} |
3740
|
|
|
errors = append(errors, err) |
3741
|
|
|
} |
3742
|
|
|
|
3743
|
|
|
if !_SchemaWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3744
|
|
|
err := SchemaWriteRequestValidationError{ |
3745
|
|
|
field: "TenantId", |
3746
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3747
|
|
|
} |
3748
|
|
|
if !all { |
3749
|
|
|
return err |
3750
|
|
|
} |
3751
|
|
|
errors = append(errors, err) |
3752
|
|
|
} |
3753
|
|
|
|
3754
|
|
|
// no validation rules for Schema |
3755
|
|
|
|
3756
|
|
|
if len(errors) > 0 { |
3757
|
|
|
return SchemaWriteRequestMultiError(errors) |
3758
|
|
|
} |
3759
|
|
|
|
3760
|
|
|
return nil |
3761
|
|
|
} |
3762
|
|
|
|
3763
|
|
|
// SchemaWriteRequestMultiError is an error wrapping multiple validation errors |
3764
|
|
|
// returned by SchemaWriteRequest.ValidateAll() if the designated constraints |
3765
|
|
|
// aren't met. |
3766
|
|
|
type SchemaWriteRequestMultiError []error |
3767
|
|
|
|
3768
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3769
|
|
|
func (m SchemaWriteRequestMultiError) Error() string { |
3770
|
|
|
var msgs []string |
3771
|
|
|
for _, err := range m { |
3772
|
|
|
msgs = append(msgs, err.Error()) |
3773
|
|
|
} |
3774
|
|
|
return strings.Join(msgs, "; ") |
3775
|
|
|
} |
3776
|
|
|
|
3777
|
|
|
// AllErrors returns a list of validation violation errors. |
3778
|
|
|
func (m SchemaWriteRequestMultiError) AllErrors() []error { return m } |
3779
|
|
|
|
3780
|
|
|
// SchemaWriteRequestValidationError is the validation error returned by |
3781
|
|
|
// SchemaWriteRequest.Validate if the designated constraints aren't met. |
3782
|
|
|
type SchemaWriteRequestValidationError struct { |
3783
|
|
|
field string |
3784
|
|
|
reason string |
3785
|
|
|
cause error |
3786
|
|
|
key bool |
3787
|
|
|
} |
3788
|
|
|
|
3789
|
|
|
// Field function returns field value. |
3790
|
|
|
func (e SchemaWriteRequestValidationError) Field() string { return e.field } |
3791
|
|
|
|
3792
|
|
|
// Reason function returns reason value. |
3793
|
|
|
func (e SchemaWriteRequestValidationError) Reason() string { return e.reason } |
3794
|
|
|
|
3795
|
|
|
// Cause function returns cause value. |
3796
|
|
|
func (e SchemaWriteRequestValidationError) Cause() error { return e.cause } |
3797
|
|
|
|
3798
|
|
|
// Key function returns key value. |
3799
|
|
|
func (e SchemaWriteRequestValidationError) Key() bool { return e.key } |
3800
|
|
|
|
3801
|
|
|
// ErrorName returns error name. |
3802
|
|
|
func (e SchemaWriteRequestValidationError) ErrorName() string { |
3803
|
|
|
return "SchemaWriteRequestValidationError" |
3804
|
|
|
} |
3805
|
|
|
|
3806
|
|
|
// Error satisfies the builtin error interface |
3807
|
|
|
func (e SchemaWriteRequestValidationError) Error() string { |
3808
|
|
|
cause := "" |
3809
|
|
|
if e.cause != nil { |
3810
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3811
|
|
|
} |
3812
|
|
|
|
3813
|
|
|
key := "" |
3814
|
|
|
if e.key { |
3815
|
|
|
key = "key for " |
3816
|
|
|
} |
3817
|
|
|
|
3818
|
|
|
return fmt.Sprintf( |
3819
|
|
|
"invalid %sSchemaWriteRequest.%s: %s%s", |
3820
|
|
|
key, |
3821
|
|
|
e.field, |
3822
|
|
|
e.reason, |
3823
|
|
|
cause) |
3824
|
|
|
} |
3825
|
|
|
|
3826
|
|
|
var _ error = SchemaWriteRequestValidationError{} |
3827
|
|
|
|
3828
|
|
|
var _ interface { |
3829
|
|
|
Field() string |
3830
|
|
|
Reason() string |
3831
|
|
|
Key() bool |
3832
|
|
|
Cause() error |
3833
|
|
|
ErrorName() string |
3834
|
|
|
} = SchemaWriteRequestValidationError{} |
3835
|
|
|
|
3836
|
|
|
var _SchemaWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
3837
|
|
|
|
3838
|
|
|
// Validate checks the field values on SchemaWriteResponse with the rules |
3839
|
|
|
// defined in the proto definition for this message. If any rules are |
3840
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3841
|
|
|
func (m *SchemaWriteResponse) Validate() error { |
3842
|
|
|
return m.validate(false) |
3843
|
|
|
} |
3844
|
|
|
|
3845
|
|
|
// ValidateAll checks the field values on SchemaWriteResponse with the rules |
3846
|
|
|
// defined in the proto definition for this message. If any rules are |
3847
|
|
|
// violated, the result is a list of violation errors wrapped in |
3848
|
|
|
// SchemaWriteResponseMultiError, or nil if none found. |
3849
|
|
|
func (m *SchemaWriteResponse) ValidateAll() error { |
3850
|
|
|
return m.validate(true) |
3851
|
|
|
} |
3852
|
|
|
|
3853
|
|
|
func (m *SchemaWriteResponse) validate(all bool) error { |
3854
|
|
|
if m == nil { |
3855
|
|
|
return nil |
3856
|
|
|
} |
3857
|
|
|
|
3858
|
|
|
var errors []error |
3859
|
|
|
|
3860
|
|
|
// no validation rules for SchemaVersion |
3861
|
|
|
|
3862
|
|
|
if len(errors) > 0 { |
3863
|
|
|
return SchemaWriteResponseMultiError(errors) |
3864
|
|
|
} |
3865
|
|
|
|
3866
|
|
|
return nil |
3867
|
|
|
} |
3868
|
|
|
|
3869
|
|
|
// SchemaWriteResponseMultiError is an error wrapping multiple validation |
3870
|
|
|
// errors returned by SchemaWriteResponse.ValidateAll() if the designated |
3871
|
|
|
// constraints aren't met. |
3872
|
|
|
type SchemaWriteResponseMultiError []error |
3873
|
|
|
|
3874
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
3875
|
|
|
func (m SchemaWriteResponseMultiError) Error() string { |
3876
|
|
|
var msgs []string |
3877
|
|
|
for _, err := range m { |
3878
|
|
|
msgs = append(msgs, err.Error()) |
3879
|
|
|
} |
3880
|
|
|
return strings.Join(msgs, "; ") |
3881
|
|
|
} |
3882
|
|
|
|
3883
|
|
|
// AllErrors returns a list of validation violation errors. |
3884
|
|
|
func (m SchemaWriteResponseMultiError) AllErrors() []error { return m } |
3885
|
|
|
|
3886
|
|
|
// SchemaWriteResponseValidationError is the validation error returned by |
3887
|
|
|
// SchemaWriteResponse.Validate if the designated constraints aren't met. |
3888
|
|
|
type SchemaWriteResponseValidationError struct { |
3889
|
|
|
field string |
3890
|
|
|
reason string |
3891
|
|
|
cause error |
3892
|
|
|
key bool |
3893
|
|
|
} |
3894
|
|
|
|
3895
|
|
|
// Field function returns field value. |
3896
|
|
|
func (e SchemaWriteResponseValidationError) Field() string { return e.field } |
3897
|
|
|
|
3898
|
|
|
// Reason function returns reason value. |
3899
|
|
|
func (e SchemaWriteResponseValidationError) Reason() string { return e.reason } |
3900
|
|
|
|
3901
|
|
|
// Cause function returns cause value. |
3902
|
|
|
func (e SchemaWriteResponseValidationError) Cause() error { return e.cause } |
3903
|
|
|
|
3904
|
|
|
// Key function returns key value. |
3905
|
|
|
func (e SchemaWriteResponseValidationError) Key() bool { return e.key } |
3906
|
|
|
|
3907
|
|
|
// ErrorName returns error name. |
3908
|
|
|
func (e SchemaWriteResponseValidationError) ErrorName() string { |
3909
|
|
|
return "SchemaWriteResponseValidationError" |
3910
|
|
|
} |
3911
|
|
|
|
3912
|
|
|
// Error satisfies the builtin error interface |
3913
|
|
|
func (e SchemaWriteResponseValidationError) Error() string { |
3914
|
|
|
cause := "" |
3915
|
|
|
if e.cause != nil { |
3916
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
3917
|
|
|
} |
3918
|
|
|
|
3919
|
|
|
key := "" |
3920
|
|
|
if e.key { |
3921
|
|
|
key = "key for " |
3922
|
|
|
} |
3923
|
|
|
|
3924
|
|
|
return fmt.Sprintf( |
3925
|
|
|
"invalid %sSchemaWriteResponse.%s: %s%s", |
3926
|
|
|
key, |
3927
|
|
|
e.field, |
3928
|
|
|
e.reason, |
3929
|
|
|
cause) |
3930
|
|
|
} |
3931
|
|
|
|
3932
|
|
|
var _ error = SchemaWriteResponseValidationError{} |
3933
|
|
|
|
3934
|
|
|
var _ interface { |
3935
|
|
|
Field() string |
3936
|
|
|
Reason() string |
3937
|
|
|
Key() bool |
3938
|
|
|
Cause() error |
3939
|
|
|
ErrorName() string |
3940
|
|
|
} = SchemaWriteResponseValidationError{} |
3941
|
|
|
|
3942
|
|
|
// Validate checks the field values on SchemaPartialWriteRequest with the rules |
3943
|
|
|
// defined in the proto definition for this message. If any rules are |
3944
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
3945
|
|
|
func (m *SchemaPartialWriteRequest) Validate() error { |
3946
|
|
|
return m.validate(false) |
3947
|
|
|
} |
3948
|
|
|
|
3949
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteRequest with the |
3950
|
|
|
// rules defined in the proto definition for this message. If any rules are |
3951
|
|
|
// violated, the result is a list of violation errors wrapped in |
3952
|
|
|
// SchemaPartialWriteRequestMultiError, or nil if none found. |
3953
|
|
|
func (m *SchemaPartialWriteRequest) ValidateAll() error { |
3954
|
|
|
return m.validate(true) |
3955
|
|
|
} |
3956
|
|
|
|
3957
|
|
|
func (m *SchemaPartialWriteRequest) validate(all bool) error { |
3958
|
|
|
if m == nil { |
3959
|
|
|
return nil |
3960
|
|
|
} |
3961
|
|
|
|
3962
|
|
|
var errors []error |
3963
|
|
|
|
3964
|
|
|
if len(m.GetTenantId()) > 128 { |
3965
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
3966
|
|
|
field: "TenantId", |
3967
|
|
|
reason: "value length must be at most 128 bytes", |
3968
|
|
|
} |
3969
|
|
|
if !all { |
3970
|
|
|
return err |
3971
|
|
|
} |
3972
|
|
|
errors = append(errors, err) |
3973
|
|
|
} |
3974
|
|
|
|
3975
|
|
|
if !_SchemaPartialWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
3976
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
3977
|
|
|
field: "TenantId", |
3978
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
3979
|
|
|
} |
3980
|
|
|
if !all { |
3981
|
|
|
return err |
3982
|
|
|
} |
3983
|
|
|
errors = append(errors, err) |
3984
|
|
|
} |
3985
|
|
|
|
3986
|
|
|
if m.GetMetadata() == nil { |
3987
|
|
|
err := SchemaPartialWriteRequestValidationError{ |
3988
|
|
|
field: "Metadata", |
3989
|
|
|
reason: "value is required", |
3990
|
|
|
} |
3991
|
|
|
if !all { |
3992
|
|
|
return err |
3993
|
|
|
} |
3994
|
|
|
errors = append(errors, err) |
3995
|
|
|
} |
3996
|
|
|
|
3997
|
|
|
if all { |
3998
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
3999
|
|
|
case interface{ ValidateAll() error }: |
4000
|
|
|
if err := v.ValidateAll(); err != nil { |
4001
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4002
|
|
|
field: "Metadata", |
4003
|
|
|
reason: "embedded message failed validation", |
4004
|
|
|
cause: err, |
4005
|
|
|
}) |
4006
|
|
|
} |
4007
|
|
|
case interface{ Validate() error }: |
4008
|
|
|
if err := v.Validate(); err != nil { |
4009
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4010
|
|
|
field: "Metadata", |
4011
|
|
|
reason: "embedded message failed validation", |
4012
|
|
|
cause: err, |
4013
|
|
|
}) |
4014
|
|
|
} |
4015
|
|
|
} |
4016
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
4017
|
|
|
if err := v.Validate(); err != nil { |
4018
|
|
|
return SchemaPartialWriteRequestValidationError{ |
4019
|
|
|
field: "Metadata", |
4020
|
|
|
reason: "embedded message failed validation", |
4021
|
|
|
cause: err, |
4022
|
|
|
} |
4023
|
|
|
} |
4024
|
|
|
} |
4025
|
|
|
|
4026
|
|
|
{ |
4027
|
|
|
sorted_keys := make([]string, len(m.GetPartials())) |
4028
|
|
|
i := 0 |
4029
|
|
|
for key := range m.GetPartials() { |
4030
|
|
|
sorted_keys[i] = key |
4031
|
|
|
i++ |
4032
|
|
|
} |
4033
|
|
|
sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] }) |
4034
|
|
|
for _, key := range sorted_keys { |
4035
|
|
|
val := m.GetPartials()[key] |
4036
|
|
|
_ = val |
4037
|
|
|
|
4038
|
|
|
// no validation rules for Partials[key] |
4039
|
|
|
|
4040
|
|
|
if all { |
4041
|
|
|
switch v := interface{}(val).(type) { |
4042
|
|
|
case interface{ ValidateAll() error }: |
4043
|
|
|
if err := v.ValidateAll(); err != nil { |
4044
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4045
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4046
|
|
|
reason: "embedded message failed validation", |
4047
|
|
|
cause: err, |
4048
|
|
|
}) |
4049
|
|
|
} |
4050
|
|
|
case interface{ Validate() error }: |
4051
|
|
|
if err := v.Validate(); err != nil { |
4052
|
|
|
errors = append(errors, SchemaPartialWriteRequestValidationError{ |
4053
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4054
|
|
|
reason: "embedded message failed validation", |
4055
|
|
|
cause: err, |
4056
|
|
|
}) |
4057
|
|
|
} |
4058
|
|
|
} |
4059
|
|
|
} else if v, ok := interface{}(val).(interface{ Validate() error }); ok { |
4060
|
|
|
if err := v.Validate(); err != nil { |
4061
|
|
|
return SchemaPartialWriteRequestValidationError{ |
4062
|
|
|
field: fmt.Sprintf("Partials[%v]", key), |
4063
|
|
|
reason: "embedded message failed validation", |
4064
|
|
|
cause: err, |
4065
|
|
|
} |
4066
|
|
|
} |
4067
|
|
|
} |
4068
|
|
|
|
4069
|
|
|
} |
4070
|
|
|
} |
4071
|
|
|
|
4072
|
|
|
if len(errors) > 0 { |
4073
|
|
|
return SchemaPartialWriteRequestMultiError(errors) |
4074
|
|
|
} |
4075
|
|
|
|
4076
|
|
|
return nil |
4077
|
|
|
} |
4078
|
|
|
|
4079
|
|
|
// SchemaPartialWriteRequestMultiError is an error wrapping multiple validation |
4080
|
|
|
// errors returned by SchemaPartialWriteRequest.ValidateAll() if the |
4081
|
|
|
// designated constraints aren't met. |
4082
|
|
|
type SchemaPartialWriteRequestMultiError []error |
4083
|
|
|
|
4084
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4085
|
|
|
func (m SchemaPartialWriteRequestMultiError) Error() string { |
4086
|
|
|
var msgs []string |
4087
|
|
|
for _, err := range m { |
4088
|
|
|
msgs = append(msgs, err.Error()) |
4089
|
|
|
} |
4090
|
|
|
return strings.Join(msgs, "; ") |
4091
|
|
|
} |
4092
|
|
|
|
4093
|
|
|
// AllErrors returns a list of validation violation errors. |
4094
|
|
|
func (m SchemaPartialWriteRequestMultiError) AllErrors() []error { return m } |
4095
|
|
|
|
4096
|
|
|
// SchemaPartialWriteRequestValidationError is the validation error returned by |
4097
|
|
|
// SchemaPartialWriteRequest.Validate if the designated constraints aren't met. |
4098
|
|
|
type SchemaPartialWriteRequestValidationError struct { |
4099
|
|
|
field string |
4100
|
|
|
reason string |
4101
|
|
|
cause error |
4102
|
|
|
key bool |
4103
|
|
|
} |
4104
|
|
|
|
4105
|
|
|
// Field function returns field value. |
4106
|
|
|
func (e SchemaPartialWriteRequestValidationError) Field() string { return e.field } |
4107
|
|
|
|
4108
|
|
|
// Reason function returns reason value. |
4109
|
|
|
func (e SchemaPartialWriteRequestValidationError) Reason() string { return e.reason } |
4110
|
|
|
|
4111
|
|
|
// Cause function returns cause value. |
4112
|
|
|
func (e SchemaPartialWriteRequestValidationError) Cause() error { return e.cause } |
4113
|
|
|
|
4114
|
|
|
// Key function returns key value. |
4115
|
|
|
func (e SchemaPartialWriteRequestValidationError) Key() bool { return e.key } |
4116
|
|
|
|
4117
|
|
|
// ErrorName returns error name. |
4118
|
|
|
func (e SchemaPartialWriteRequestValidationError) ErrorName() string { |
4119
|
|
|
return "SchemaPartialWriteRequestValidationError" |
4120
|
|
|
} |
4121
|
|
|
|
4122
|
|
|
// Error satisfies the builtin error interface |
4123
|
|
|
func (e SchemaPartialWriteRequestValidationError) Error() string { |
4124
|
|
|
cause := "" |
4125
|
|
|
if e.cause != nil { |
4126
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4127
|
|
|
} |
4128
|
|
|
|
4129
|
|
|
key := "" |
4130
|
|
|
if e.key { |
4131
|
|
|
key = "key for " |
4132
|
|
|
} |
4133
|
|
|
|
4134
|
|
|
return fmt.Sprintf( |
4135
|
|
|
"invalid %sSchemaPartialWriteRequest.%s: %s%s", |
4136
|
|
|
key, |
4137
|
|
|
e.field, |
4138
|
|
|
e.reason, |
4139
|
|
|
cause) |
4140
|
|
|
} |
4141
|
|
|
|
4142
|
|
|
var _ error = SchemaPartialWriteRequestValidationError{} |
4143
|
|
|
|
4144
|
|
|
var _ interface { |
4145
|
|
|
Field() string |
4146
|
|
|
Reason() string |
4147
|
|
|
Key() bool |
4148
|
|
|
Cause() error |
4149
|
|
|
ErrorName() string |
4150
|
|
|
} = SchemaPartialWriteRequestValidationError{} |
4151
|
|
|
|
4152
|
|
|
var _SchemaPartialWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4153
|
|
|
|
4154
|
|
|
// Validate checks the field values on SchemaPartialWriteRequestMetadata with |
4155
|
|
|
// the rules defined in the proto definition for this message. If any rules |
4156
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
4157
|
|
|
// no violations. |
4158
|
|
|
func (m *SchemaPartialWriteRequestMetadata) Validate() error { |
4159
|
|
|
return m.validate(false) |
4160
|
|
|
} |
4161
|
|
|
|
4162
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteRequestMetadata |
4163
|
|
|
// with the rules defined in the proto definition for this message. If any |
4164
|
|
|
// rules are violated, the result is a list of violation errors wrapped in |
4165
|
|
|
// SchemaPartialWriteRequestMetadataMultiError, or nil if none found. |
4166
|
|
|
func (m *SchemaPartialWriteRequestMetadata) ValidateAll() error { |
4167
|
|
|
return m.validate(true) |
4168
|
|
|
} |
4169
|
|
|
|
4170
|
|
|
func (m *SchemaPartialWriteRequestMetadata) validate(all bool) error { |
4171
|
|
|
if m == nil { |
4172
|
|
|
return nil |
4173
|
|
|
} |
4174
|
|
|
|
4175
|
|
|
var errors []error |
4176
|
|
|
|
4177
|
|
|
// no validation rules for SchemaVersion |
4178
|
|
|
|
4179
|
|
|
if len(errors) > 0 { |
4180
|
|
|
return SchemaPartialWriteRequestMetadataMultiError(errors) |
4181
|
|
|
} |
4182
|
|
|
|
4183
|
|
|
return nil |
4184
|
|
|
} |
4185
|
|
|
|
4186
|
|
|
// SchemaPartialWriteRequestMetadataMultiError is an error wrapping multiple |
4187
|
|
|
// validation errors returned by |
4188
|
|
|
// SchemaPartialWriteRequestMetadata.ValidateAll() if the designated |
4189
|
|
|
// constraints aren't met. |
4190
|
|
|
type SchemaPartialWriteRequestMetadataMultiError []error |
4191
|
|
|
|
4192
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4193
|
|
|
func (m SchemaPartialWriteRequestMetadataMultiError) Error() string { |
4194
|
|
|
var msgs []string |
4195
|
|
|
for _, err := range m { |
4196
|
|
|
msgs = append(msgs, err.Error()) |
4197
|
|
|
} |
4198
|
|
|
return strings.Join(msgs, "; ") |
4199
|
|
|
} |
4200
|
|
|
|
4201
|
|
|
// AllErrors returns a list of validation violation errors. |
4202
|
|
|
func (m SchemaPartialWriteRequestMetadataMultiError) AllErrors() []error { return m } |
4203
|
|
|
|
4204
|
|
|
// SchemaPartialWriteRequestMetadataValidationError is the validation error |
4205
|
|
|
// returned by SchemaPartialWriteRequestMetadata.Validate if the designated |
4206
|
|
|
// constraints aren't met. |
4207
|
|
|
type SchemaPartialWriteRequestMetadataValidationError struct { |
4208
|
|
|
field string |
4209
|
|
|
reason string |
4210
|
|
|
cause error |
4211
|
|
|
key bool |
4212
|
|
|
} |
4213
|
|
|
|
4214
|
|
|
// Field function returns field value. |
4215
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Field() string { return e.field } |
4216
|
|
|
|
4217
|
|
|
// Reason function returns reason value. |
4218
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Reason() string { return e.reason } |
4219
|
|
|
|
4220
|
|
|
// Cause function returns cause value. |
4221
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Cause() error { return e.cause } |
4222
|
|
|
|
4223
|
|
|
// Key function returns key value. |
4224
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Key() bool { return e.key } |
4225
|
|
|
|
4226
|
|
|
// ErrorName returns error name. |
4227
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) ErrorName() string { |
4228
|
|
|
return "SchemaPartialWriteRequestMetadataValidationError" |
4229
|
|
|
} |
4230
|
|
|
|
4231
|
|
|
// Error satisfies the builtin error interface |
4232
|
|
|
func (e SchemaPartialWriteRequestMetadataValidationError) Error() string { |
4233
|
|
|
cause := "" |
4234
|
|
|
if e.cause != nil { |
4235
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4236
|
|
|
} |
4237
|
|
|
|
4238
|
|
|
key := "" |
4239
|
|
|
if e.key { |
4240
|
|
|
key = "key for " |
4241
|
|
|
} |
4242
|
|
|
|
4243
|
|
|
return fmt.Sprintf( |
4244
|
|
|
"invalid %sSchemaPartialWriteRequestMetadata.%s: %s%s", |
4245
|
|
|
key, |
4246
|
|
|
e.field, |
4247
|
|
|
e.reason, |
4248
|
|
|
cause) |
4249
|
|
|
} |
4250
|
|
|
|
4251
|
|
|
var _ error = SchemaPartialWriteRequestMetadataValidationError{} |
4252
|
|
|
|
4253
|
|
|
var _ interface { |
4254
|
|
|
Field() string |
4255
|
|
|
Reason() string |
4256
|
|
|
Key() bool |
4257
|
|
|
Cause() error |
4258
|
|
|
ErrorName() string |
4259
|
|
|
} = SchemaPartialWriteRequestMetadataValidationError{} |
4260
|
|
|
|
4261
|
|
|
// Validate checks the field values on SchemaPartialWriteResponse with the |
4262
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4263
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4264
|
|
|
func (m *SchemaPartialWriteResponse) Validate() error { |
4265
|
|
|
return m.validate(false) |
4266
|
|
|
} |
4267
|
|
|
|
4268
|
|
|
// ValidateAll checks the field values on SchemaPartialWriteResponse with the |
4269
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4270
|
|
|
// violated, the result is a list of violation errors wrapped in |
4271
|
|
|
// SchemaPartialWriteResponseMultiError, or nil if none found. |
4272
|
|
|
func (m *SchemaPartialWriteResponse) ValidateAll() error { |
4273
|
|
|
return m.validate(true) |
4274
|
|
|
} |
4275
|
|
|
|
4276
|
|
|
func (m *SchemaPartialWriteResponse) validate(all bool) error { |
4277
|
|
|
if m == nil { |
4278
|
|
|
return nil |
4279
|
|
|
} |
4280
|
|
|
|
4281
|
|
|
var errors []error |
4282
|
|
|
|
4283
|
|
|
// no validation rules for SchemaVersion |
4284
|
|
|
|
4285
|
|
|
if len(errors) > 0 { |
4286
|
|
|
return SchemaPartialWriteResponseMultiError(errors) |
4287
|
|
|
} |
4288
|
|
|
|
4289
|
|
|
return nil |
4290
|
|
|
} |
4291
|
|
|
|
4292
|
|
|
// SchemaPartialWriteResponseMultiError is an error wrapping multiple |
4293
|
|
|
// validation errors returned by SchemaPartialWriteResponse.ValidateAll() if |
4294
|
|
|
// the designated constraints aren't met. |
4295
|
|
|
type SchemaPartialWriteResponseMultiError []error |
4296
|
|
|
|
4297
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4298
|
|
|
func (m SchemaPartialWriteResponseMultiError) Error() string { |
4299
|
|
|
var msgs []string |
4300
|
|
|
for _, err := range m { |
4301
|
|
|
msgs = append(msgs, err.Error()) |
4302
|
|
|
} |
4303
|
|
|
return strings.Join(msgs, "; ") |
4304
|
|
|
} |
4305
|
|
|
|
4306
|
|
|
// AllErrors returns a list of validation violation errors. |
4307
|
|
|
func (m SchemaPartialWriteResponseMultiError) AllErrors() []error { return m } |
4308
|
|
|
|
4309
|
|
|
// SchemaPartialWriteResponseValidationError is the validation error returned |
4310
|
|
|
// by SchemaPartialWriteResponse.Validate if the designated constraints aren't met. |
4311
|
|
|
type SchemaPartialWriteResponseValidationError struct { |
4312
|
|
|
field string |
4313
|
|
|
reason string |
4314
|
|
|
cause error |
4315
|
|
|
key bool |
4316
|
|
|
} |
4317
|
|
|
|
4318
|
|
|
// Field function returns field value. |
4319
|
|
|
func (e SchemaPartialWriteResponseValidationError) Field() string { return e.field } |
4320
|
|
|
|
4321
|
|
|
// Reason function returns reason value. |
4322
|
|
|
func (e SchemaPartialWriteResponseValidationError) Reason() string { return e.reason } |
4323
|
|
|
|
4324
|
|
|
// Cause function returns cause value. |
4325
|
|
|
func (e SchemaPartialWriteResponseValidationError) Cause() error { return e.cause } |
4326
|
|
|
|
4327
|
|
|
// Key function returns key value. |
4328
|
|
|
func (e SchemaPartialWriteResponseValidationError) Key() bool { return e.key } |
4329
|
|
|
|
4330
|
|
|
// ErrorName returns error name. |
4331
|
|
|
func (e SchemaPartialWriteResponseValidationError) ErrorName() string { |
4332
|
|
|
return "SchemaPartialWriteResponseValidationError" |
4333
|
|
|
} |
4334
|
|
|
|
4335
|
|
|
// Error satisfies the builtin error interface |
4336
|
|
|
func (e SchemaPartialWriteResponseValidationError) Error() string { |
4337
|
|
|
cause := "" |
4338
|
|
|
if e.cause != nil { |
4339
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4340
|
|
|
} |
4341
|
|
|
|
4342
|
|
|
key := "" |
4343
|
|
|
if e.key { |
4344
|
|
|
key = "key for " |
4345
|
|
|
} |
4346
|
|
|
|
4347
|
|
|
return fmt.Sprintf( |
4348
|
|
|
"invalid %sSchemaPartialWriteResponse.%s: %s%s", |
4349
|
|
|
key, |
4350
|
|
|
e.field, |
4351
|
|
|
e.reason, |
4352
|
|
|
cause) |
4353
|
|
|
} |
4354
|
|
|
|
4355
|
|
|
var _ error = SchemaPartialWriteResponseValidationError{} |
4356
|
|
|
|
4357
|
|
|
var _ interface { |
4358
|
|
|
Field() string |
4359
|
|
|
Reason() string |
4360
|
|
|
Key() bool |
4361
|
|
|
Cause() error |
4362
|
|
|
ErrorName() string |
4363
|
|
|
} = SchemaPartialWriteResponseValidationError{} |
4364
|
|
|
|
4365
|
|
|
// Validate checks the field values on SchemaReadRequest with the rules defined |
4366
|
|
|
// in the proto definition for this message. If any rules are violated, the |
4367
|
|
|
// first error encountered is returned, or nil if there are no violations. |
4368
|
|
|
func (m *SchemaReadRequest) Validate() error { |
4369
|
|
|
return m.validate(false) |
4370
|
|
|
} |
4371
|
|
|
|
4372
|
|
|
// ValidateAll checks the field values on SchemaReadRequest with the rules |
4373
|
|
|
// defined in the proto definition for this message. If any rules are |
4374
|
|
|
// violated, the result is a list of violation errors wrapped in |
4375
|
|
|
// SchemaReadRequestMultiError, or nil if none found. |
4376
|
|
|
func (m *SchemaReadRequest) ValidateAll() error { |
4377
|
|
|
return m.validate(true) |
4378
|
|
|
} |
4379
|
|
|
|
4380
|
|
|
func (m *SchemaReadRequest) validate(all bool) error { |
4381
|
|
|
if m == nil { |
4382
|
|
|
return nil |
4383
|
|
|
} |
4384
|
|
|
|
4385
|
|
|
var errors []error |
4386
|
|
|
|
4387
|
|
|
if len(m.GetTenantId()) > 128 { |
4388
|
|
|
err := SchemaReadRequestValidationError{ |
4389
|
|
|
field: "TenantId", |
4390
|
|
|
reason: "value length must be at most 128 bytes", |
4391
|
|
|
} |
4392
|
|
|
if !all { |
4393
|
|
|
return err |
4394
|
|
|
} |
4395
|
|
|
errors = append(errors, err) |
4396
|
|
|
} |
4397
|
|
|
|
4398
|
|
|
if !_SchemaReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4399
|
|
|
err := SchemaReadRequestValidationError{ |
4400
|
|
|
field: "TenantId", |
4401
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4402
|
|
|
} |
4403
|
|
|
if !all { |
4404
|
|
|
return err |
4405
|
|
|
} |
4406
|
|
|
errors = append(errors, err) |
4407
|
|
|
} |
4408
|
|
|
|
4409
|
|
|
if m.GetMetadata() == nil { |
4410
|
|
|
err := SchemaReadRequestValidationError{ |
4411
|
|
|
field: "Metadata", |
4412
|
|
|
reason: "value is required", |
4413
|
|
|
} |
4414
|
|
|
if !all { |
4415
|
|
|
return err |
4416
|
|
|
} |
4417
|
|
|
errors = append(errors, err) |
4418
|
|
|
} |
4419
|
|
|
|
4420
|
|
|
if all { |
4421
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
4422
|
|
|
case interface{ ValidateAll() error }: |
4423
|
|
|
if err := v.ValidateAll(); err != nil { |
4424
|
|
|
errors = append(errors, SchemaReadRequestValidationError{ |
4425
|
|
|
field: "Metadata", |
4426
|
|
|
reason: "embedded message failed validation", |
4427
|
|
|
cause: err, |
4428
|
|
|
}) |
4429
|
|
|
} |
4430
|
|
|
case interface{ Validate() error }: |
4431
|
|
|
if err := v.Validate(); err != nil { |
4432
|
|
|
errors = append(errors, SchemaReadRequestValidationError{ |
4433
|
|
|
field: "Metadata", |
4434
|
|
|
reason: "embedded message failed validation", |
4435
|
|
|
cause: err, |
4436
|
|
|
}) |
4437
|
|
|
} |
4438
|
|
|
} |
4439
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
4440
|
|
|
if err := v.Validate(); err != nil { |
4441
|
|
|
return SchemaReadRequestValidationError{ |
4442
|
|
|
field: "Metadata", |
4443
|
|
|
reason: "embedded message failed validation", |
4444
|
|
|
cause: err, |
4445
|
|
|
} |
4446
|
|
|
} |
4447
|
|
|
} |
4448
|
|
|
|
4449
|
|
|
if len(errors) > 0 { |
4450
|
|
|
return SchemaReadRequestMultiError(errors) |
4451
|
|
|
} |
4452
|
|
|
|
4453
|
|
|
return nil |
4454
|
|
|
} |
4455
|
|
|
|
4456
|
|
|
// SchemaReadRequestMultiError is an error wrapping multiple validation errors |
4457
|
|
|
// returned by SchemaReadRequest.ValidateAll() if the designated constraints |
4458
|
|
|
// aren't met. |
4459
|
|
|
type SchemaReadRequestMultiError []error |
4460
|
|
|
|
4461
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4462
|
|
|
func (m SchemaReadRequestMultiError) Error() string { |
4463
|
|
|
var msgs []string |
4464
|
|
|
for _, err := range m { |
4465
|
|
|
msgs = append(msgs, err.Error()) |
4466
|
|
|
} |
4467
|
|
|
return strings.Join(msgs, "; ") |
4468
|
|
|
} |
4469
|
|
|
|
4470
|
|
|
// AllErrors returns a list of validation violation errors. |
4471
|
|
|
func (m SchemaReadRequestMultiError) AllErrors() []error { return m } |
4472
|
|
|
|
4473
|
|
|
// SchemaReadRequestValidationError is the validation error returned by |
4474
|
|
|
// SchemaReadRequest.Validate if the designated constraints aren't met. |
4475
|
|
|
type SchemaReadRequestValidationError struct { |
4476
|
|
|
field string |
4477
|
|
|
reason string |
4478
|
|
|
cause error |
4479
|
|
|
key bool |
4480
|
|
|
} |
4481
|
|
|
|
4482
|
|
|
// Field function returns field value. |
4483
|
|
|
func (e SchemaReadRequestValidationError) Field() string { return e.field } |
4484
|
|
|
|
4485
|
|
|
// Reason function returns reason value. |
4486
|
|
|
func (e SchemaReadRequestValidationError) Reason() string { return e.reason } |
4487
|
|
|
|
4488
|
|
|
// Cause function returns cause value. |
4489
|
|
|
func (e SchemaReadRequestValidationError) Cause() error { return e.cause } |
4490
|
|
|
|
4491
|
|
|
// Key function returns key value. |
4492
|
|
|
func (e SchemaReadRequestValidationError) Key() bool { return e.key } |
4493
|
|
|
|
4494
|
|
|
// ErrorName returns error name. |
4495
|
|
|
func (e SchemaReadRequestValidationError) ErrorName() string { |
4496
|
|
|
return "SchemaReadRequestValidationError" |
4497
|
|
|
} |
4498
|
|
|
|
4499
|
|
|
// Error satisfies the builtin error interface |
4500
|
|
|
func (e SchemaReadRequestValidationError) Error() string { |
4501
|
|
|
cause := "" |
4502
|
|
|
if e.cause != nil { |
4503
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4504
|
|
|
} |
4505
|
|
|
|
4506
|
|
|
key := "" |
4507
|
|
|
if e.key { |
4508
|
|
|
key = "key for " |
4509
|
|
|
} |
4510
|
|
|
|
4511
|
|
|
return fmt.Sprintf( |
4512
|
|
|
"invalid %sSchemaReadRequest.%s: %s%s", |
4513
|
|
|
key, |
4514
|
|
|
e.field, |
4515
|
|
|
e.reason, |
4516
|
|
|
cause) |
4517
|
|
|
} |
4518
|
|
|
|
4519
|
|
|
var _ error = SchemaReadRequestValidationError{} |
4520
|
|
|
|
4521
|
|
|
var _ interface { |
4522
|
|
|
Field() string |
4523
|
|
|
Reason() string |
4524
|
|
|
Key() bool |
4525
|
|
|
Cause() error |
4526
|
|
|
ErrorName() string |
4527
|
|
|
} = SchemaReadRequestValidationError{} |
4528
|
|
|
|
4529
|
|
|
var _SchemaReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4530
|
|
|
|
4531
|
|
|
// Validate checks the field values on SchemaReadRequestMetadata with the rules |
4532
|
|
|
// defined in the proto definition for this message. If any rules are |
4533
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4534
|
|
|
func (m *SchemaReadRequestMetadata) Validate() error { |
4535
|
|
|
return m.validate(false) |
4536
|
|
|
} |
4537
|
|
|
|
4538
|
|
|
// ValidateAll checks the field values on SchemaReadRequestMetadata with the |
4539
|
|
|
// rules defined in the proto definition for this message. If any rules are |
4540
|
|
|
// violated, the result is a list of violation errors wrapped in |
4541
|
|
|
// SchemaReadRequestMetadataMultiError, or nil if none found. |
4542
|
|
|
func (m *SchemaReadRequestMetadata) ValidateAll() error { |
4543
|
|
|
return m.validate(true) |
4544
|
|
|
} |
4545
|
|
|
|
4546
|
|
|
func (m *SchemaReadRequestMetadata) validate(all bool) error { |
4547
|
|
|
if m == nil { |
4548
|
|
|
return nil |
4549
|
|
|
} |
4550
|
|
|
|
4551
|
|
|
var errors []error |
4552
|
|
|
|
4553
|
|
|
// no validation rules for SchemaVersion |
4554
|
|
|
|
4555
|
|
|
if len(errors) > 0 { |
4556
|
|
|
return SchemaReadRequestMetadataMultiError(errors) |
4557
|
|
|
} |
4558
|
|
|
|
4559
|
|
|
return nil |
4560
|
|
|
} |
4561
|
|
|
|
4562
|
|
|
// SchemaReadRequestMetadataMultiError is an error wrapping multiple validation |
4563
|
|
|
// errors returned by SchemaReadRequestMetadata.ValidateAll() if the |
4564
|
|
|
// designated constraints aren't met. |
4565
|
|
|
type SchemaReadRequestMetadataMultiError []error |
4566
|
|
|
|
4567
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4568
|
|
|
func (m SchemaReadRequestMetadataMultiError) Error() string { |
4569
|
|
|
var msgs []string |
4570
|
|
|
for _, err := range m { |
4571
|
|
|
msgs = append(msgs, err.Error()) |
4572
|
|
|
} |
4573
|
|
|
return strings.Join(msgs, "; ") |
4574
|
|
|
} |
4575
|
|
|
|
4576
|
|
|
// AllErrors returns a list of validation violation errors. |
4577
|
|
|
func (m SchemaReadRequestMetadataMultiError) AllErrors() []error { return m } |
4578
|
|
|
|
4579
|
|
|
// SchemaReadRequestMetadataValidationError is the validation error returned by |
4580
|
|
|
// SchemaReadRequestMetadata.Validate if the designated constraints aren't met. |
4581
|
|
|
type SchemaReadRequestMetadataValidationError struct { |
4582
|
|
|
field string |
4583
|
|
|
reason string |
4584
|
|
|
cause error |
4585
|
|
|
key bool |
4586
|
|
|
} |
4587
|
|
|
|
4588
|
|
|
// Field function returns field value. |
4589
|
|
|
func (e SchemaReadRequestMetadataValidationError) Field() string { return e.field } |
4590
|
|
|
|
4591
|
|
|
// Reason function returns reason value. |
4592
|
|
|
func (e SchemaReadRequestMetadataValidationError) Reason() string { return e.reason } |
4593
|
|
|
|
4594
|
|
|
// Cause function returns cause value. |
4595
|
|
|
func (e SchemaReadRequestMetadataValidationError) Cause() error { return e.cause } |
4596
|
|
|
|
4597
|
|
|
// Key function returns key value. |
4598
|
|
|
func (e SchemaReadRequestMetadataValidationError) Key() bool { return e.key } |
4599
|
|
|
|
4600
|
|
|
// ErrorName returns error name. |
4601
|
|
|
func (e SchemaReadRequestMetadataValidationError) ErrorName() string { |
4602
|
|
|
return "SchemaReadRequestMetadataValidationError" |
4603
|
|
|
} |
4604
|
|
|
|
4605
|
|
|
// Error satisfies the builtin error interface |
4606
|
|
|
func (e SchemaReadRequestMetadataValidationError) Error() string { |
4607
|
|
|
cause := "" |
4608
|
|
|
if e.cause != nil { |
4609
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4610
|
|
|
} |
4611
|
|
|
|
4612
|
|
|
key := "" |
4613
|
|
|
if e.key { |
4614
|
|
|
key = "key for " |
4615
|
|
|
} |
4616
|
|
|
|
4617
|
|
|
return fmt.Sprintf( |
4618
|
|
|
"invalid %sSchemaReadRequestMetadata.%s: %s%s", |
4619
|
|
|
key, |
4620
|
|
|
e.field, |
4621
|
|
|
e.reason, |
4622
|
|
|
cause) |
4623
|
|
|
} |
4624
|
|
|
|
4625
|
|
|
var _ error = SchemaReadRequestMetadataValidationError{} |
4626
|
|
|
|
4627
|
|
|
var _ interface { |
4628
|
|
|
Field() string |
4629
|
|
|
Reason() string |
4630
|
|
|
Key() bool |
4631
|
|
|
Cause() error |
4632
|
|
|
ErrorName() string |
4633
|
|
|
} = SchemaReadRequestMetadataValidationError{} |
4634
|
|
|
|
4635
|
|
|
// Validate checks the field values on SchemaReadResponse with the rules |
4636
|
|
|
// defined in the proto definition for this message. If any rules are |
4637
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4638
|
|
|
func (m *SchemaReadResponse) Validate() error { |
4639
|
|
|
return m.validate(false) |
4640
|
|
|
} |
4641
|
|
|
|
4642
|
|
|
// ValidateAll checks the field values on SchemaReadResponse with the rules |
4643
|
|
|
// defined in the proto definition for this message. If any rules are |
4644
|
|
|
// violated, the result is a list of violation errors wrapped in |
4645
|
|
|
// SchemaReadResponseMultiError, or nil if none found. |
4646
|
|
|
func (m *SchemaReadResponse) ValidateAll() error { |
4647
|
|
|
return m.validate(true) |
4648
|
|
|
} |
4649
|
|
|
|
4650
|
|
|
func (m *SchemaReadResponse) validate(all bool) error { |
4651
|
|
|
if m == nil { |
4652
|
|
|
return nil |
4653
|
|
|
} |
4654
|
|
|
|
4655
|
|
|
var errors []error |
4656
|
|
|
|
4657
|
|
|
if all { |
4658
|
|
|
switch v := interface{}(m.GetSchema()).(type) { |
4659
|
|
|
case interface{ ValidateAll() error }: |
4660
|
|
|
if err := v.ValidateAll(); err != nil { |
4661
|
|
|
errors = append(errors, SchemaReadResponseValidationError{ |
4662
|
|
|
field: "Schema", |
4663
|
|
|
reason: "embedded message failed validation", |
4664
|
|
|
cause: err, |
4665
|
|
|
}) |
4666
|
|
|
} |
4667
|
|
|
case interface{ Validate() error }: |
4668
|
|
|
if err := v.Validate(); err != nil { |
4669
|
|
|
errors = append(errors, SchemaReadResponseValidationError{ |
4670
|
|
|
field: "Schema", |
4671
|
|
|
reason: "embedded message failed validation", |
4672
|
|
|
cause: err, |
4673
|
|
|
}) |
4674
|
|
|
} |
4675
|
|
|
} |
4676
|
|
|
} else if v, ok := interface{}(m.GetSchema()).(interface{ Validate() error }); ok { |
4677
|
|
|
if err := v.Validate(); err != nil { |
4678
|
|
|
return SchemaReadResponseValidationError{ |
4679
|
|
|
field: "Schema", |
4680
|
|
|
reason: "embedded message failed validation", |
4681
|
|
|
cause: err, |
4682
|
|
|
} |
4683
|
|
|
} |
4684
|
|
|
} |
4685
|
|
|
|
4686
|
|
|
if len(errors) > 0 { |
4687
|
|
|
return SchemaReadResponseMultiError(errors) |
4688
|
|
|
} |
4689
|
|
|
|
4690
|
|
|
return nil |
4691
|
|
|
} |
4692
|
|
|
|
4693
|
|
|
// SchemaReadResponseMultiError is an error wrapping multiple validation errors |
4694
|
|
|
// returned by SchemaReadResponse.ValidateAll() if the designated constraints |
4695
|
|
|
// aren't met. |
4696
|
|
|
type SchemaReadResponseMultiError []error |
4697
|
|
|
|
4698
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4699
|
|
|
func (m SchemaReadResponseMultiError) Error() string { |
4700
|
|
|
var msgs []string |
4701
|
|
|
for _, err := range m { |
4702
|
|
|
msgs = append(msgs, err.Error()) |
4703
|
|
|
} |
4704
|
|
|
return strings.Join(msgs, "; ") |
4705
|
|
|
} |
4706
|
|
|
|
4707
|
|
|
// AllErrors returns a list of validation violation errors. |
4708
|
|
|
func (m SchemaReadResponseMultiError) AllErrors() []error { return m } |
4709
|
|
|
|
4710
|
|
|
// SchemaReadResponseValidationError is the validation error returned by |
4711
|
|
|
// SchemaReadResponse.Validate if the designated constraints aren't met. |
4712
|
|
|
type SchemaReadResponseValidationError struct { |
4713
|
|
|
field string |
4714
|
|
|
reason string |
4715
|
|
|
cause error |
4716
|
|
|
key bool |
4717
|
|
|
} |
4718
|
|
|
|
4719
|
|
|
// Field function returns field value. |
4720
|
|
|
func (e SchemaReadResponseValidationError) Field() string { return e.field } |
4721
|
|
|
|
4722
|
|
|
// Reason function returns reason value. |
4723
|
|
|
func (e SchemaReadResponseValidationError) Reason() string { return e.reason } |
4724
|
|
|
|
4725
|
|
|
// Cause function returns cause value. |
4726
|
|
|
func (e SchemaReadResponseValidationError) Cause() error { return e.cause } |
4727
|
|
|
|
4728
|
|
|
// Key function returns key value. |
4729
|
|
|
func (e SchemaReadResponseValidationError) Key() bool { return e.key } |
4730
|
|
|
|
4731
|
|
|
// ErrorName returns error name. |
4732
|
|
|
func (e SchemaReadResponseValidationError) ErrorName() string { |
4733
|
|
|
return "SchemaReadResponseValidationError" |
4734
|
|
|
} |
4735
|
|
|
|
4736
|
|
|
// Error satisfies the builtin error interface |
4737
|
|
|
func (e SchemaReadResponseValidationError) Error() string { |
4738
|
|
|
cause := "" |
4739
|
|
|
if e.cause != nil { |
4740
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4741
|
|
|
} |
4742
|
|
|
|
4743
|
|
|
key := "" |
4744
|
|
|
if e.key { |
4745
|
|
|
key = "key for " |
4746
|
|
|
} |
4747
|
|
|
|
4748
|
|
|
return fmt.Sprintf( |
4749
|
|
|
"invalid %sSchemaReadResponse.%s: %s%s", |
4750
|
|
|
key, |
4751
|
|
|
e.field, |
4752
|
|
|
e.reason, |
4753
|
|
|
cause) |
4754
|
|
|
} |
4755
|
|
|
|
4756
|
|
|
var _ error = SchemaReadResponseValidationError{} |
4757
|
|
|
|
4758
|
|
|
var _ interface { |
4759
|
|
|
Field() string |
4760
|
|
|
Reason() string |
4761
|
|
|
Key() bool |
4762
|
|
|
Cause() error |
4763
|
|
|
ErrorName() string |
4764
|
|
|
} = SchemaReadResponseValidationError{} |
4765
|
|
|
|
4766
|
|
|
// Validate checks the field values on SchemaListRequest with the rules defined |
4767
|
|
|
// in the proto definition for this message. If any rules are violated, the |
4768
|
|
|
// first error encountered is returned, or nil if there are no violations. |
4769
|
|
|
func (m *SchemaListRequest) Validate() error { |
4770
|
|
|
return m.validate(false) |
4771
|
|
|
} |
4772
|
|
|
|
4773
|
|
|
// ValidateAll checks the field values on SchemaListRequest with the rules |
4774
|
|
|
// defined in the proto definition for this message. If any rules are |
4775
|
|
|
// violated, the result is a list of violation errors wrapped in |
4776
|
|
|
// SchemaListRequestMultiError, or nil if none found. |
4777
|
|
|
func (m *SchemaListRequest) ValidateAll() error { |
4778
|
|
|
return m.validate(true) |
4779
|
|
|
} |
4780
|
|
|
|
4781
|
|
|
func (m *SchemaListRequest) validate(all bool) error { |
4782
|
|
|
if m == nil { |
4783
|
|
|
return nil |
4784
|
|
|
} |
4785
|
|
|
|
4786
|
|
|
var errors []error |
4787
|
|
|
|
4788
|
|
|
if len(m.GetTenantId()) > 128 { |
4789
|
|
|
err := SchemaListRequestValidationError{ |
4790
|
|
|
field: "TenantId", |
4791
|
|
|
reason: "value length must be at most 128 bytes", |
4792
|
|
|
} |
4793
|
|
|
if !all { |
4794
|
|
|
return err |
4795
|
|
|
} |
4796
|
|
|
errors = append(errors, err) |
4797
|
|
|
} |
4798
|
|
|
|
4799
|
|
|
if !_SchemaListRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
4800
|
|
|
err := SchemaListRequestValidationError{ |
4801
|
|
|
field: "TenantId", |
4802
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
4803
|
|
|
} |
4804
|
|
|
if !all { |
4805
|
|
|
return err |
4806
|
|
|
} |
4807
|
|
|
errors = append(errors, err) |
4808
|
|
|
} |
4809
|
|
|
|
4810
|
|
|
if m.GetPageSize() != 0 { |
4811
|
|
|
|
4812
|
|
|
if m.GetPageSize() < 1 { |
4813
|
|
|
err := SchemaListRequestValidationError{ |
4814
|
|
|
field: "PageSize", |
4815
|
|
|
reason: "value must be greater than or equal to 1", |
4816
|
|
|
} |
4817
|
|
|
if !all { |
4818
|
|
|
return err |
4819
|
|
|
} |
4820
|
|
|
errors = append(errors, err) |
4821
|
|
|
} |
4822
|
|
|
|
4823
|
|
|
} |
4824
|
|
|
|
4825
|
|
|
if m.GetContinuousToken() != "" { |
4826
|
|
|
|
4827
|
|
|
} |
4828
|
|
|
|
4829
|
|
|
if len(errors) > 0 { |
4830
|
|
|
return SchemaListRequestMultiError(errors) |
4831
|
|
|
} |
4832
|
|
|
|
4833
|
|
|
return nil |
4834
|
|
|
} |
4835
|
|
|
|
4836
|
|
|
// SchemaListRequestMultiError is an error wrapping multiple validation errors |
4837
|
|
|
// returned by SchemaListRequest.ValidateAll() if the designated constraints |
4838
|
|
|
// aren't met. |
4839
|
|
|
type SchemaListRequestMultiError []error |
4840
|
|
|
|
4841
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4842
|
|
|
func (m SchemaListRequestMultiError) Error() string { |
4843
|
|
|
var msgs []string |
4844
|
|
|
for _, err := range m { |
4845
|
|
|
msgs = append(msgs, err.Error()) |
4846
|
|
|
} |
4847
|
|
|
return strings.Join(msgs, "; ") |
4848
|
|
|
} |
4849
|
|
|
|
4850
|
|
|
// AllErrors returns a list of validation violation errors. |
4851
|
|
|
func (m SchemaListRequestMultiError) AllErrors() []error { return m } |
4852
|
|
|
|
4853
|
|
|
// SchemaListRequestValidationError is the validation error returned by |
4854
|
|
|
// SchemaListRequest.Validate if the designated constraints aren't met. |
4855
|
|
|
type SchemaListRequestValidationError struct { |
4856
|
|
|
field string |
4857
|
|
|
reason string |
4858
|
|
|
cause error |
4859
|
|
|
key bool |
4860
|
|
|
} |
4861
|
|
|
|
4862
|
|
|
// Field function returns field value. |
4863
|
|
|
func (e SchemaListRequestValidationError) Field() string { return e.field } |
4864
|
|
|
|
4865
|
|
|
// Reason function returns reason value. |
4866
|
|
|
func (e SchemaListRequestValidationError) Reason() string { return e.reason } |
4867
|
|
|
|
4868
|
|
|
// Cause function returns cause value. |
4869
|
|
|
func (e SchemaListRequestValidationError) Cause() error { return e.cause } |
4870
|
|
|
|
4871
|
|
|
// Key function returns key value. |
4872
|
|
|
func (e SchemaListRequestValidationError) Key() bool { return e.key } |
4873
|
|
|
|
4874
|
|
|
// ErrorName returns error name. |
4875
|
|
|
func (e SchemaListRequestValidationError) ErrorName() string { |
4876
|
|
|
return "SchemaListRequestValidationError" |
4877
|
|
|
} |
4878
|
|
|
|
4879
|
|
|
// Error satisfies the builtin error interface |
4880
|
|
|
func (e SchemaListRequestValidationError) Error() string { |
4881
|
|
|
cause := "" |
4882
|
|
|
if e.cause != nil { |
4883
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
4884
|
|
|
} |
4885
|
|
|
|
4886
|
|
|
key := "" |
4887
|
|
|
if e.key { |
4888
|
|
|
key = "key for " |
4889
|
|
|
} |
4890
|
|
|
|
4891
|
|
|
return fmt.Sprintf( |
4892
|
|
|
"invalid %sSchemaListRequest.%s: %s%s", |
4893
|
|
|
key, |
4894
|
|
|
e.field, |
4895
|
|
|
e.reason, |
4896
|
|
|
cause) |
4897
|
|
|
} |
4898
|
|
|
|
4899
|
|
|
var _ error = SchemaListRequestValidationError{} |
4900
|
|
|
|
4901
|
|
|
var _ interface { |
4902
|
|
|
Field() string |
4903
|
|
|
Reason() string |
4904
|
|
|
Key() bool |
4905
|
|
|
Cause() error |
4906
|
|
|
ErrorName() string |
4907
|
|
|
} = SchemaListRequestValidationError{} |
4908
|
|
|
|
4909
|
|
|
var _SchemaListRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
4910
|
|
|
|
4911
|
|
|
// Validate checks the field values on SchemaListResponse with the rules |
4912
|
|
|
// defined in the proto definition for this message. If any rules are |
4913
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
4914
|
|
|
func (m *SchemaListResponse) Validate() error { |
4915
|
|
|
return m.validate(false) |
4916
|
|
|
} |
4917
|
|
|
|
4918
|
|
|
// ValidateAll checks the field values on SchemaListResponse with the rules |
4919
|
|
|
// defined in the proto definition for this message. If any rules are |
4920
|
|
|
// violated, the result is a list of violation errors wrapped in |
4921
|
|
|
// SchemaListResponseMultiError, or nil if none found. |
4922
|
|
|
func (m *SchemaListResponse) ValidateAll() error { |
4923
|
|
|
return m.validate(true) |
4924
|
|
|
} |
4925
|
|
|
|
4926
|
|
|
func (m *SchemaListResponse) validate(all bool) error { |
4927
|
|
|
if m == nil { |
4928
|
|
|
return nil |
4929
|
|
|
} |
4930
|
|
|
|
4931
|
|
|
var errors []error |
4932
|
|
|
|
4933
|
|
|
// no validation rules for Head |
4934
|
|
|
|
4935
|
|
|
for idx, item := range m.GetSchemas() { |
4936
|
|
|
_, _ = idx, item |
4937
|
|
|
|
4938
|
|
|
if all { |
4939
|
|
|
switch v := interface{}(item).(type) { |
4940
|
|
|
case interface{ ValidateAll() error }: |
4941
|
|
|
if err := v.ValidateAll(); err != nil { |
4942
|
|
|
errors = append(errors, SchemaListResponseValidationError{ |
4943
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
4944
|
|
|
reason: "embedded message failed validation", |
4945
|
|
|
cause: err, |
4946
|
|
|
}) |
4947
|
|
|
} |
4948
|
|
|
case interface{ Validate() error }: |
4949
|
|
|
if err := v.Validate(); err != nil { |
4950
|
|
|
errors = append(errors, SchemaListResponseValidationError{ |
4951
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
4952
|
|
|
reason: "embedded message failed validation", |
4953
|
|
|
cause: err, |
4954
|
|
|
}) |
4955
|
|
|
} |
4956
|
|
|
} |
4957
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
4958
|
|
|
if err := v.Validate(); err != nil { |
4959
|
|
|
return SchemaListResponseValidationError{ |
4960
|
|
|
field: fmt.Sprintf("Schemas[%v]", idx), |
4961
|
|
|
reason: "embedded message failed validation", |
4962
|
|
|
cause: err, |
4963
|
|
|
} |
4964
|
|
|
} |
4965
|
|
|
} |
4966
|
|
|
|
4967
|
|
|
} |
4968
|
|
|
|
4969
|
|
|
// no validation rules for ContinuousToken |
4970
|
|
|
|
4971
|
|
|
if len(errors) > 0 { |
4972
|
|
|
return SchemaListResponseMultiError(errors) |
4973
|
|
|
} |
4974
|
|
|
|
4975
|
|
|
return nil |
4976
|
|
|
} |
4977
|
|
|
|
4978
|
|
|
// SchemaListResponseMultiError is an error wrapping multiple validation errors |
4979
|
|
|
// returned by SchemaListResponse.ValidateAll() if the designated constraints |
4980
|
|
|
// aren't met. |
4981
|
|
|
type SchemaListResponseMultiError []error |
4982
|
|
|
|
4983
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
4984
|
|
|
func (m SchemaListResponseMultiError) Error() string { |
4985
|
|
|
var msgs []string |
4986
|
|
|
for _, err := range m { |
4987
|
|
|
msgs = append(msgs, err.Error()) |
4988
|
|
|
} |
4989
|
|
|
return strings.Join(msgs, "; ") |
4990
|
|
|
} |
4991
|
|
|
|
4992
|
|
|
// AllErrors returns a list of validation violation errors. |
4993
|
|
|
func (m SchemaListResponseMultiError) AllErrors() []error { return m } |
4994
|
|
|
|
4995
|
|
|
// SchemaListResponseValidationError is the validation error returned by |
4996
|
|
|
// SchemaListResponse.Validate if the designated constraints aren't met. |
4997
|
|
|
type SchemaListResponseValidationError struct { |
4998
|
|
|
field string |
4999
|
|
|
reason string |
5000
|
|
|
cause error |
5001
|
|
|
key bool |
5002
|
|
|
} |
5003
|
|
|
|
5004
|
|
|
// Field function returns field value. |
5005
|
|
|
func (e SchemaListResponseValidationError) Field() string { return e.field } |
5006
|
|
|
|
5007
|
|
|
// Reason function returns reason value. |
5008
|
|
|
func (e SchemaListResponseValidationError) Reason() string { return e.reason } |
5009
|
|
|
|
5010
|
|
|
// Cause function returns cause value. |
5011
|
|
|
func (e SchemaListResponseValidationError) Cause() error { return e.cause } |
5012
|
|
|
|
5013
|
|
|
// Key function returns key value. |
5014
|
|
|
func (e SchemaListResponseValidationError) Key() bool { return e.key } |
5015
|
|
|
|
5016
|
|
|
// ErrorName returns error name. |
5017
|
|
|
func (e SchemaListResponseValidationError) ErrorName() string { |
5018
|
|
|
return "SchemaListResponseValidationError" |
5019
|
|
|
} |
5020
|
|
|
|
5021
|
|
|
// Error satisfies the builtin error interface |
5022
|
|
|
func (e SchemaListResponseValidationError) Error() string { |
5023
|
|
|
cause := "" |
5024
|
|
|
if e.cause != nil { |
5025
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5026
|
|
|
} |
5027
|
|
|
|
5028
|
|
|
key := "" |
5029
|
|
|
if e.key { |
5030
|
|
|
key = "key for " |
5031
|
|
|
} |
5032
|
|
|
|
5033
|
|
|
return fmt.Sprintf( |
5034
|
|
|
"invalid %sSchemaListResponse.%s: %s%s", |
5035
|
|
|
key, |
5036
|
|
|
e.field, |
5037
|
|
|
e.reason, |
5038
|
|
|
cause) |
5039
|
|
|
} |
5040
|
|
|
|
5041
|
|
|
var _ error = SchemaListResponseValidationError{} |
5042
|
|
|
|
5043
|
|
|
var _ interface { |
5044
|
|
|
Field() string |
5045
|
|
|
Reason() string |
5046
|
|
|
Key() bool |
5047
|
|
|
Cause() error |
5048
|
|
|
ErrorName() string |
5049
|
|
|
} = SchemaListResponseValidationError{} |
5050
|
|
|
|
5051
|
|
|
// Validate checks the field values on SchemaList with the rules defined in the |
5052
|
|
|
// proto definition for this message. If any rules are violated, the first |
5053
|
|
|
// error encountered is returned, or nil if there are no violations. |
5054
|
|
|
func (m *SchemaList) Validate() error { |
5055
|
|
|
return m.validate(false) |
5056
|
|
|
} |
5057
|
|
|
|
5058
|
|
|
// ValidateAll checks the field values on SchemaList with the rules defined in |
5059
|
|
|
// the proto definition for this message. If any rules are violated, the |
5060
|
|
|
// result is a list of violation errors wrapped in SchemaListMultiError, or |
5061
|
|
|
// nil if none found. |
5062
|
|
|
func (m *SchemaList) ValidateAll() error { |
5063
|
|
|
return m.validate(true) |
5064
|
|
|
} |
5065
|
|
|
|
5066
|
|
|
func (m *SchemaList) validate(all bool) error { |
5067
|
|
|
if m == nil { |
5068
|
|
|
return nil |
5069
|
|
|
} |
5070
|
|
|
|
5071
|
|
|
var errors []error |
5072
|
|
|
|
5073
|
|
|
// no validation rules for Version |
5074
|
|
|
|
5075
|
|
|
// no validation rules for CreatedAt |
5076
|
|
|
|
5077
|
|
|
if len(errors) > 0 { |
5078
|
|
|
return SchemaListMultiError(errors) |
5079
|
|
|
} |
5080
|
|
|
|
5081
|
|
|
return nil |
5082
|
|
|
} |
5083
|
|
|
|
5084
|
|
|
// SchemaListMultiError is an error wrapping multiple validation errors |
5085
|
|
|
// returned by SchemaList.ValidateAll() if the designated constraints aren't met. |
5086
|
|
|
type SchemaListMultiError []error |
5087
|
|
|
|
5088
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5089
|
|
|
func (m SchemaListMultiError) Error() string { |
5090
|
|
|
var msgs []string |
5091
|
|
|
for _, err := range m { |
5092
|
|
|
msgs = append(msgs, err.Error()) |
5093
|
|
|
} |
5094
|
|
|
return strings.Join(msgs, "; ") |
5095
|
|
|
} |
5096
|
|
|
|
5097
|
|
|
// AllErrors returns a list of validation violation errors. |
5098
|
|
|
func (m SchemaListMultiError) AllErrors() []error { return m } |
5099
|
|
|
|
5100
|
|
|
// SchemaListValidationError is the validation error returned by |
5101
|
|
|
// SchemaList.Validate if the designated constraints aren't met. |
5102
|
|
|
type SchemaListValidationError struct { |
5103
|
|
|
field string |
5104
|
|
|
reason string |
5105
|
|
|
cause error |
5106
|
|
|
key bool |
5107
|
|
|
} |
5108
|
|
|
|
5109
|
|
|
// Field function returns field value. |
5110
|
|
|
func (e SchemaListValidationError) Field() string { return e.field } |
5111
|
|
|
|
5112
|
|
|
// Reason function returns reason value. |
5113
|
|
|
func (e SchemaListValidationError) Reason() string { return e.reason } |
5114
|
|
|
|
5115
|
|
|
// Cause function returns cause value. |
5116
|
|
|
func (e SchemaListValidationError) Cause() error { return e.cause } |
5117
|
|
|
|
5118
|
|
|
// Key function returns key value. |
5119
|
|
|
func (e SchemaListValidationError) Key() bool { return e.key } |
5120
|
|
|
|
5121
|
|
|
// ErrorName returns error name. |
5122
|
|
|
func (e SchemaListValidationError) ErrorName() string { return "SchemaListValidationError" } |
5123
|
|
|
|
5124
|
|
|
// Error satisfies the builtin error interface |
5125
|
|
|
func (e SchemaListValidationError) Error() string { |
5126
|
|
|
cause := "" |
5127
|
|
|
if e.cause != nil { |
5128
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5129
|
|
|
} |
5130
|
|
|
|
5131
|
|
|
key := "" |
5132
|
|
|
if e.key { |
5133
|
|
|
key = "key for " |
5134
|
|
|
} |
5135
|
|
|
|
5136
|
|
|
return fmt.Sprintf( |
5137
|
|
|
"invalid %sSchemaList.%s: %s%s", |
5138
|
|
|
key, |
5139
|
|
|
e.field, |
5140
|
|
|
e.reason, |
5141
|
|
|
cause) |
5142
|
|
|
} |
5143
|
|
|
|
5144
|
|
|
var _ error = SchemaListValidationError{} |
5145
|
|
|
|
5146
|
|
|
var _ interface { |
5147
|
|
|
Field() string |
5148
|
|
|
Reason() string |
5149
|
|
|
Key() bool |
5150
|
|
|
Cause() error |
5151
|
|
|
ErrorName() string |
5152
|
|
|
} = SchemaListValidationError{} |
5153
|
|
|
|
5154
|
|
|
// Validate checks the field values on DataWriteRequest with the rules defined |
5155
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5156
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5157
|
|
|
func (m *DataWriteRequest) Validate() error { |
5158
|
|
|
return m.validate(false) |
5159
|
|
|
} |
5160
|
|
|
|
5161
|
|
|
// ValidateAll checks the field values on DataWriteRequest with the rules |
5162
|
|
|
// defined in the proto definition for this message. If any rules are |
5163
|
|
|
// violated, the result is a list of violation errors wrapped in |
5164
|
|
|
// DataWriteRequestMultiError, or nil if none found. |
5165
|
|
|
func (m *DataWriteRequest) ValidateAll() error { |
5166
|
|
|
return m.validate(true) |
5167
|
|
|
} |
5168
|
|
|
|
5169
|
|
|
func (m *DataWriteRequest) validate(all bool) error { |
5170
|
|
|
if m == nil { |
5171
|
|
|
return nil |
5172
|
|
|
} |
5173
|
|
|
|
5174
|
|
|
var errors []error |
5175
|
|
|
|
5176
|
|
|
if len(m.GetTenantId()) > 128 { |
5177
|
|
|
err := DataWriteRequestValidationError{ |
5178
|
|
|
field: "TenantId", |
5179
|
|
|
reason: "value length must be at most 128 bytes", |
5180
|
|
|
} |
5181
|
|
|
if !all { |
5182
|
|
|
return err |
5183
|
|
|
} |
5184
|
|
|
errors = append(errors, err) |
5185
|
|
|
} |
5186
|
|
|
|
5187
|
|
|
if !_DataWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5188
|
|
|
err := DataWriteRequestValidationError{ |
5189
|
|
|
field: "TenantId", |
5190
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5191
|
|
|
} |
5192
|
|
|
if !all { |
5193
|
|
|
return err |
5194
|
|
|
} |
5195
|
|
|
errors = append(errors, err) |
5196
|
|
|
} |
5197
|
|
|
|
5198
|
|
|
if m.GetMetadata() == nil { |
5199
|
|
|
err := DataWriteRequestValidationError{ |
5200
|
|
|
field: "Metadata", |
5201
|
|
|
reason: "value is required", |
5202
|
|
|
} |
5203
|
|
|
if !all { |
5204
|
|
|
return err |
5205
|
|
|
} |
5206
|
|
|
errors = append(errors, err) |
5207
|
|
|
} |
5208
|
|
|
|
5209
|
|
|
if all { |
5210
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
5211
|
|
|
case interface{ ValidateAll() error }: |
5212
|
|
|
if err := v.ValidateAll(); err != nil { |
5213
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5214
|
|
|
field: "Metadata", |
5215
|
|
|
reason: "embedded message failed validation", |
5216
|
|
|
cause: err, |
5217
|
|
|
}) |
5218
|
|
|
} |
5219
|
|
|
case interface{ Validate() error }: |
5220
|
|
|
if err := v.Validate(); err != nil { |
5221
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5222
|
|
|
field: "Metadata", |
5223
|
|
|
reason: "embedded message failed validation", |
5224
|
|
|
cause: err, |
5225
|
|
|
}) |
5226
|
|
|
} |
5227
|
|
|
} |
5228
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
5229
|
|
|
if err := v.Validate(); err != nil { |
5230
|
|
|
return DataWriteRequestValidationError{ |
5231
|
|
|
field: "Metadata", |
5232
|
|
|
reason: "embedded message failed validation", |
5233
|
|
|
cause: err, |
5234
|
|
|
} |
5235
|
|
|
} |
5236
|
|
|
} |
5237
|
|
|
|
5238
|
|
|
for idx, item := range m.GetTuples() { |
5239
|
|
|
_, _ = idx, item |
5240
|
|
|
|
5241
|
|
|
if item == nil { |
5242
|
|
|
err := DataWriteRequestValidationError{ |
5243
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5244
|
|
|
reason: "value is required", |
5245
|
|
|
} |
5246
|
|
|
if !all { |
5247
|
|
|
return err |
5248
|
|
|
} |
5249
|
|
|
errors = append(errors, err) |
5250
|
|
|
} |
5251
|
|
|
|
5252
|
|
|
if all { |
5253
|
|
|
switch v := interface{}(item).(type) { |
5254
|
|
|
case interface{ ValidateAll() error }: |
5255
|
|
|
if err := v.ValidateAll(); err != nil { |
5256
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5257
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5258
|
|
|
reason: "embedded message failed validation", |
5259
|
|
|
cause: err, |
5260
|
|
|
}) |
5261
|
|
|
} |
5262
|
|
|
case interface{ Validate() error }: |
5263
|
|
|
if err := v.Validate(); err != nil { |
5264
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5265
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5266
|
|
|
reason: "embedded message failed validation", |
5267
|
|
|
cause: err, |
5268
|
|
|
}) |
5269
|
|
|
} |
5270
|
|
|
} |
5271
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
5272
|
|
|
if err := v.Validate(); err != nil { |
5273
|
|
|
return DataWriteRequestValidationError{ |
5274
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5275
|
|
|
reason: "embedded message failed validation", |
5276
|
|
|
cause: err, |
5277
|
|
|
} |
5278
|
|
|
} |
5279
|
|
|
} |
5280
|
|
|
|
5281
|
|
|
} |
5282
|
|
|
|
5283
|
|
|
for idx, item := range m.GetAttributes() { |
5284
|
|
|
_, _ = idx, item |
5285
|
|
|
|
5286
|
|
|
if item == nil { |
5287
|
|
|
err := DataWriteRequestValidationError{ |
5288
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
5289
|
|
|
reason: "value is required", |
5290
|
|
|
} |
5291
|
|
|
if !all { |
5292
|
|
|
return err |
5293
|
|
|
} |
5294
|
|
|
errors = append(errors, err) |
5295
|
|
|
} |
5296
|
|
|
|
5297
|
|
|
if all { |
5298
|
|
|
switch v := interface{}(item).(type) { |
5299
|
|
|
case interface{ ValidateAll() error }: |
5300
|
|
|
if err := v.ValidateAll(); err != nil { |
5301
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5302
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
5303
|
|
|
reason: "embedded message failed validation", |
5304
|
|
|
cause: err, |
5305
|
|
|
}) |
5306
|
|
|
} |
5307
|
|
|
case interface{ Validate() error }: |
5308
|
|
|
if err := v.Validate(); err != nil { |
5309
|
|
|
errors = append(errors, DataWriteRequestValidationError{ |
5310
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
5311
|
|
|
reason: "embedded message failed validation", |
5312
|
|
|
cause: err, |
5313
|
|
|
}) |
5314
|
|
|
} |
5315
|
|
|
} |
5316
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
5317
|
|
|
if err := v.Validate(); err != nil { |
5318
|
|
|
return DataWriteRequestValidationError{ |
5319
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
5320
|
|
|
reason: "embedded message failed validation", |
5321
|
|
|
cause: err, |
5322
|
|
|
} |
5323
|
|
|
} |
5324
|
|
|
} |
5325
|
|
|
|
5326
|
|
|
} |
5327
|
|
|
|
5328
|
|
|
if len(errors) > 0 { |
5329
|
|
|
return DataWriteRequestMultiError(errors) |
5330
|
|
|
} |
5331
|
|
|
|
5332
|
|
|
return nil |
5333
|
|
|
} |
5334
|
|
|
|
5335
|
|
|
// DataWriteRequestMultiError is an error wrapping multiple validation errors |
5336
|
|
|
// returned by DataWriteRequest.ValidateAll() if the designated constraints |
5337
|
|
|
// aren't met. |
5338
|
|
|
type DataWriteRequestMultiError []error |
5339
|
|
|
|
5340
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5341
|
|
|
func (m DataWriteRequestMultiError) Error() string { |
5342
|
|
|
var msgs []string |
5343
|
|
|
for _, err := range m { |
5344
|
|
|
msgs = append(msgs, err.Error()) |
5345
|
|
|
} |
5346
|
|
|
return strings.Join(msgs, "; ") |
5347
|
|
|
} |
5348
|
|
|
|
5349
|
|
|
// AllErrors returns a list of validation violation errors. |
5350
|
|
|
func (m DataWriteRequestMultiError) AllErrors() []error { return m } |
5351
|
|
|
|
5352
|
|
|
// DataWriteRequestValidationError is the validation error returned by |
5353
|
|
|
// DataWriteRequest.Validate if the designated constraints aren't met. |
5354
|
|
|
type DataWriteRequestValidationError struct { |
5355
|
|
|
field string |
5356
|
|
|
reason string |
5357
|
|
|
cause error |
5358
|
|
|
key bool |
5359
|
|
|
} |
5360
|
|
|
|
5361
|
|
|
// Field function returns field value. |
5362
|
|
|
func (e DataWriteRequestValidationError) Field() string { return e.field } |
5363
|
|
|
|
5364
|
|
|
// Reason function returns reason value. |
5365
|
|
|
func (e DataWriteRequestValidationError) Reason() string { return e.reason } |
5366
|
|
|
|
5367
|
|
|
// Cause function returns cause value. |
5368
|
|
|
func (e DataWriteRequestValidationError) Cause() error { return e.cause } |
5369
|
|
|
|
5370
|
|
|
// Key function returns key value. |
5371
|
|
|
func (e DataWriteRequestValidationError) Key() bool { return e.key } |
5372
|
|
|
|
5373
|
|
|
// ErrorName returns error name. |
5374
|
|
|
func (e DataWriteRequestValidationError) ErrorName() string { return "DataWriteRequestValidationError" } |
5375
|
|
|
|
5376
|
|
|
// Error satisfies the builtin error interface |
5377
|
|
|
func (e DataWriteRequestValidationError) Error() string { |
5378
|
|
|
cause := "" |
5379
|
|
|
if e.cause != nil { |
5380
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5381
|
|
|
} |
5382
|
|
|
|
5383
|
|
|
key := "" |
5384
|
|
|
if e.key { |
5385
|
|
|
key = "key for " |
5386
|
|
|
} |
5387
|
|
|
|
5388
|
|
|
return fmt.Sprintf( |
5389
|
|
|
"invalid %sDataWriteRequest.%s: %s%s", |
5390
|
|
|
key, |
5391
|
|
|
e.field, |
5392
|
|
|
e.reason, |
5393
|
|
|
cause) |
5394
|
|
|
} |
5395
|
|
|
|
5396
|
|
|
var _ error = DataWriteRequestValidationError{} |
5397
|
|
|
|
5398
|
|
|
var _ interface { |
5399
|
|
|
Field() string |
5400
|
|
|
Reason() string |
5401
|
|
|
Key() bool |
5402
|
|
|
Cause() error |
5403
|
|
|
ErrorName() string |
5404
|
|
|
} = DataWriteRequestValidationError{} |
5405
|
|
|
|
5406
|
|
|
var _DataWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
5407
|
|
|
|
5408
|
|
|
// Validate checks the field values on DataWriteRequestMetadata with the rules |
5409
|
|
|
// defined in the proto definition for this message. If any rules are |
5410
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5411
|
|
|
func (m *DataWriteRequestMetadata) Validate() error { |
5412
|
|
|
return m.validate(false) |
5413
|
|
|
} |
5414
|
|
|
|
5415
|
|
|
// ValidateAll checks the field values on DataWriteRequestMetadata with the |
5416
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5417
|
|
|
// violated, the result is a list of violation errors wrapped in |
5418
|
|
|
// DataWriteRequestMetadataMultiError, or nil if none found. |
5419
|
|
|
func (m *DataWriteRequestMetadata) ValidateAll() error { |
5420
|
|
|
return m.validate(true) |
5421
|
|
|
} |
5422
|
|
|
|
5423
|
|
|
func (m *DataWriteRequestMetadata) validate(all bool) error { |
5424
|
|
|
if m == nil { |
5425
|
|
|
return nil |
5426
|
|
|
} |
5427
|
|
|
|
5428
|
|
|
var errors []error |
5429
|
|
|
|
5430
|
|
|
// no validation rules for SchemaVersion |
5431
|
|
|
|
5432
|
|
|
if len(errors) > 0 { |
5433
|
|
|
return DataWriteRequestMetadataMultiError(errors) |
5434
|
|
|
} |
5435
|
|
|
|
5436
|
|
|
return nil |
5437
|
|
|
} |
5438
|
|
|
|
5439
|
|
|
// DataWriteRequestMetadataMultiError is an error wrapping multiple validation |
5440
|
|
|
// errors returned by DataWriteRequestMetadata.ValidateAll() if the designated |
5441
|
|
|
// constraints aren't met. |
5442
|
|
|
type DataWriteRequestMetadataMultiError []error |
5443
|
|
|
|
5444
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5445
|
|
|
func (m DataWriteRequestMetadataMultiError) Error() string { |
5446
|
|
|
var msgs []string |
5447
|
|
|
for _, err := range m { |
5448
|
|
|
msgs = append(msgs, err.Error()) |
5449
|
|
|
} |
5450
|
|
|
return strings.Join(msgs, "; ") |
5451
|
|
|
} |
5452
|
|
|
|
5453
|
|
|
// AllErrors returns a list of validation violation errors. |
5454
|
|
|
func (m DataWriteRequestMetadataMultiError) AllErrors() []error { return m } |
5455
|
|
|
|
5456
|
|
|
// DataWriteRequestMetadataValidationError is the validation error returned by |
5457
|
|
|
// DataWriteRequestMetadata.Validate if the designated constraints aren't met. |
5458
|
|
|
type DataWriteRequestMetadataValidationError struct { |
5459
|
|
|
field string |
5460
|
|
|
reason string |
5461
|
|
|
cause error |
5462
|
|
|
key bool |
5463
|
|
|
} |
5464
|
|
|
|
5465
|
|
|
// Field function returns field value. |
5466
|
|
|
func (e DataWriteRequestMetadataValidationError) Field() string { return e.field } |
5467
|
|
|
|
5468
|
|
|
// Reason function returns reason value. |
5469
|
|
|
func (e DataWriteRequestMetadataValidationError) Reason() string { return e.reason } |
5470
|
|
|
|
5471
|
|
|
// Cause function returns cause value. |
5472
|
|
|
func (e DataWriteRequestMetadataValidationError) Cause() error { return e.cause } |
5473
|
|
|
|
5474
|
|
|
// Key function returns key value. |
5475
|
|
|
func (e DataWriteRequestMetadataValidationError) Key() bool { return e.key } |
5476
|
|
|
|
5477
|
|
|
// ErrorName returns error name. |
5478
|
|
|
func (e DataWriteRequestMetadataValidationError) ErrorName() string { |
5479
|
|
|
return "DataWriteRequestMetadataValidationError" |
5480
|
|
|
} |
5481
|
|
|
|
5482
|
|
|
// Error satisfies the builtin error interface |
5483
|
|
|
func (e DataWriteRequestMetadataValidationError) Error() string { |
5484
|
|
|
cause := "" |
5485
|
|
|
if e.cause != nil { |
5486
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5487
|
|
|
} |
5488
|
|
|
|
5489
|
|
|
key := "" |
5490
|
|
|
if e.key { |
5491
|
|
|
key = "key for " |
5492
|
|
|
} |
5493
|
|
|
|
5494
|
|
|
return fmt.Sprintf( |
5495
|
|
|
"invalid %sDataWriteRequestMetadata.%s: %s%s", |
5496
|
|
|
key, |
5497
|
|
|
e.field, |
5498
|
|
|
e.reason, |
5499
|
|
|
cause) |
5500
|
|
|
} |
5501
|
|
|
|
5502
|
|
|
var _ error = DataWriteRequestMetadataValidationError{} |
5503
|
|
|
|
5504
|
|
|
var _ interface { |
5505
|
|
|
Field() string |
5506
|
|
|
Reason() string |
5507
|
|
|
Key() bool |
5508
|
|
|
Cause() error |
5509
|
|
|
ErrorName() string |
5510
|
|
|
} = DataWriteRequestMetadataValidationError{} |
5511
|
|
|
|
5512
|
|
|
// Validate checks the field values on DataWriteResponse with the rules defined |
5513
|
|
|
// in the proto definition for this message. If any rules are violated, the |
5514
|
|
|
// first error encountered is returned, or nil if there are no violations. |
5515
|
|
|
func (m *DataWriteResponse) Validate() error { |
5516
|
|
|
return m.validate(false) |
5517
|
|
|
} |
5518
|
|
|
|
5519
|
|
|
// ValidateAll checks the field values on DataWriteResponse with the rules |
5520
|
|
|
// defined in the proto definition for this message. If any rules are |
5521
|
|
|
// violated, the result is a list of violation errors wrapped in |
5522
|
|
|
// DataWriteResponseMultiError, or nil if none found. |
5523
|
|
|
func (m *DataWriteResponse) ValidateAll() error { |
5524
|
|
|
return m.validate(true) |
5525
|
|
|
} |
5526
|
|
|
|
5527
|
|
|
func (m *DataWriteResponse) validate(all bool) error { |
5528
|
|
|
if m == nil { |
5529
|
|
|
return nil |
5530
|
|
|
} |
5531
|
|
|
|
5532
|
|
|
var errors []error |
5533
|
|
|
|
5534
|
|
|
// no validation rules for SnapToken |
5535
|
|
|
|
5536
|
|
|
if len(errors) > 0 { |
5537
|
|
|
return DataWriteResponseMultiError(errors) |
5538
|
|
|
} |
5539
|
|
|
|
5540
|
|
|
return nil |
5541
|
|
|
} |
5542
|
|
|
|
5543
|
|
|
// DataWriteResponseMultiError is an error wrapping multiple validation errors |
5544
|
|
|
// returned by DataWriteResponse.ValidateAll() if the designated constraints |
5545
|
|
|
// aren't met. |
5546
|
|
|
type DataWriteResponseMultiError []error |
5547
|
|
|
|
5548
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5549
|
|
|
func (m DataWriteResponseMultiError) Error() string { |
5550
|
|
|
var msgs []string |
5551
|
|
|
for _, err := range m { |
5552
|
|
|
msgs = append(msgs, err.Error()) |
5553
|
|
|
} |
5554
|
|
|
return strings.Join(msgs, "; ") |
5555
|
|
|
} |
5556
|
|
|
|
5557
|
|
|
// AllErrors returns a list of validation violation errors. |
5558
|
|
|
func (m DataWriteResponseMultiError) AllErrors() []error { return m } |
5559
|
|
|
|
5560
|
|
|
// DataWriteResponseValidationError is the validation error returned by |
5561
|
|
|
// DataWriteResponse.Validate if the designated constraints aren't met. |
5562
|
|
|
type DataWriteResponseValidationError struct { |
5563
|
|
|
field string |
5564
|
|
|
reason string |
5565
|
|
|
cause error |
5566
|
|
|
key bool |
5567
|
|
|
} |
5568
|
|
|
|
5569
|
|
|
// Field function returns field value. |
5570
|
|
|
func (e DataWriteResponseValidationError) Field() string { return e.field } |
5571
|
|
|
|
5572
|
|
|
// Reason function returns reason value. |
5573
|
|
|
func (e DataWriteResponseValidationError) Reason() string { return e.reason } |
5574
|
|
|
|
5575
|
|
|
// Cause function returns cause value. |
5576
|
|
|
func (e DataWriteResponseValidationError) Cause() error { return e.cause } |
5577
|
|
|
|
5578
|
|
|
// Key function returns key value. |
5579
|
|
|
func (e DataWriteResponseValidationError) Key() bool { return e.key } |
5580
|
|
|
|
5581
|
|
|
// ErrorName returns error name. |
5582
|
|
|
func (e DataWriteResponseValidationError) ErrorName() string { |
5583
|
|
|
return "DataWriteResponseValidationError" |
5584
|
|
|
} |
5585
|
|
|
|
5586
|
|
|
// Error satisfies the builtin error interface |
5587
|
|
|
func (e DataWriteResponseValidationError) Error() string { |
5588
|
|
|
cause := "" |
5589
|
|
|
if e.cause != nil { |
5590
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5591
|
|
|
} |
5592
|
|
|
|
5593
|
|
|
key := "" |
5594
|
|
|
if e.key { |
5595
|
|
|
key = "key for " |
5596
|
|
|
} |
5597
|
|
|
|
5598
|
|
|
return fmt.Sprintf( |
5599
|
|
|
"invalid %sDataWriteResponse.%s: %s%s", |
5600
|
|
|
key, |
5601
|
|
|
e.field, |
5602
|
|
|
e.reason, |
5603
|
|
|
cause) |
5604
|
|
|
} |
5605
|
|
|
|
5606
|
|
|
var _ error = DataWriteResponseValidationError{} |
5607
|
|
|
|
5608
|
|
|
var _ interface { |
5609
|
|
|
Field() string |
5610
|
|
|
Reason() string |
5611
|
|
|
Key() bool |
5612
|
|
|
Cause() error |
5613
|
|
|
ErrorName() string |
5614
|
|
|
} = DataWriteResponseValidationError{} |
5615
|
|
|
|
5616
|
|
|
// Validate checks the field values on RelationshipWriteRequest with the rules |
5617
|
|
|
// defined in the proto definition for this message. If any rules are |
5618
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5619
|
|
|
func (m *RelationshipWriteRequest) Validate() error { |
5620
|
|
|
return m.validate(false) |
5621
|
|
|
} |
5622
|
|
|
|
5623
|
|
|
// ValidateAll checks the field values on RelationshipWriteRequest with the |
5624
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5625
|
|
|
// violated, the result is a list of violation errors wrapped in |
5626
|
|
|
// RelationshipWriteRequestMultiError, or nil if none found. |
5627
|
|
|
func (m *RelationshipWriteRequest) ValidateAll() error { |
5628
|
|
|
return m.validate(true) |
5629
|
|
|
} |
5630
|
|
|
|
5631
|
|
|
func (m *RelationshipWriteRequest) validate(all bool) error { |
5632
|
|
|
if m == nil { |
5633
|
|
|
return nil |
5634
|
|
|
} |
5635
|
|
|
|
5636
|
|
|
var errors []error |
5637
|
|
|
|
5638
|
|
|
if len(m.GetTenantId()) > 128 { |
5639
|
|
|
err := RelationshipWriteRequestValidationError{ |
5640
|
|
|
field: "TenantId", |
5641
|
|
|
reason: "value length must be at most 128 bytes", |
5642
|
|
|
} |
5643
|
|
|
if !all { |
5644
|
|
|
return err |
5645
|
|
|
} |
5646
|
|
|
errors = append(errors, err) |
5647
|
|
|
} |
5648
|
|
|
|
5649
|
|
|
if !_RelationshipWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
5650
|
|
|
err := RelationshipWriteRequestValidationError{ |
5651
|
|
|
field: "TenantId", |
5652
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
5653
|
|
|
} |
5654
|
|
|
if !all { |
5655
|
|
|
return err |
5656
|
|
|
} |
5657
|
|
|
errors = append(errors, err) |
5658
|
|
|
} |
5659
|
|
|
|
5660
|
|
|
if m.GetMetadata() == nil { |
5661
|
|
|
err := RelationshipWriteRequestValidationError{ |
5662
|
|
|
field: "Metadata", |
5663
|
|
|
reason: "value is required", |
5664
|
|
|
} |
5665
|
|
|
if !all { |
5666
|
|
|
return err |
5667
|
|
|
} |
5668
|
|
|
errors = append(errors, err) |
5669
|
|
|
} |
5670
|
|
|
|
5671
|
|
|
if all { |
5672
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
5673
|
|
|
case interface{ ValidateAll() error }: |
5674
|
|
|
if err := v.ValidateAll(); err != nil { |
5675
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
5676
|
|
|
field: "Metadata", |
5677
|
|
|
reason: "embedded message failed validation", |
5678
|
|
|
cause: err, |
5679
|
|
|
}) |
5680
|
|
|
} |
5681
|
|
|
case interface{ Validate() error }: |
5682
|
|
|
if err := v.Validate(); err != nil { |
5683
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
5684
|
|
|
field: "Metadata", |
5685
|
|
|
reason: "embedded message failed validation", |
5686
|
|
|
cause: err, |
5687
|
|
|
}) |
5688
|
|
|
} |
5689
|
|
|
} |
5690
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
5691
|
|
|
if err := v.Validate(); err != nil { |
5692
|
|
|
return RelationshipWriteRequestValidationError{ |
5693
|
|
|
field: "Metadata", |
5694
|
|
|
reason: "embedded message failed validation", |
5695
|
|
|
cause: err, |
5696
|
|
|
} |
5697
|
|
|
} |
5698
|
|
|
} |
5699
|
|
|
|
5700
|
|
|
if len(m.GetTuples()) < 1 { |
5701
|
|
|
err := RelationshipWriteRequestValidationError{ |
5702
|
|
|
field: "Tuples", |
5703
|
|
|
reason: "value must contain at least 1 item(s)", |
5704
|
|
|
} |
5705
|
|
|
if !all { |
5706
|
|
|
return err |
5707
|
|
|
} |
5708
|
|
|
errors = append(errors, err) |
5709
|
|
|
} |
5710
|
|
|
|
5711
|
|
|
for idx, item := range m.GetTuples() { |
5712
|
|
|
_, _ = idx, item |
5713
|
|
|
|
5714
|
|
|
if item == nil { |
5715
|
|
|
err := RelationshipWriteRequestValidationError{ |
5716
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5717
|
|
|
reason: "value is required", |
5718
|
|
|
} |
5719
|
|
|
if !all { |
5720
|
|
|
return err |
5721
|
|
|
} |
5722
|
|
|
errors = append(errors, err) |
5723
|
|
|
} |
5724
|
|
|
|
5725
|
|
|
if all { |
5726
|
|
|
switch v := interface{}(item).(type) { |
5727
|
|
|
case interface{ ValidateAll() error }: |
5728
|
|
|
if err := v.ValidateAll(); err != nil { |
5729
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
5730
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5731
|
|
|
reason: "embedded message failed validation", |
5732
|
|
|
cause: err, |
5733
|
|
|
}) |
5734
|
|
|
} |
5735
|
|
|
case interface{ Validate() error }: |
5736
|
|
|
if err := v.Validate(); err != nil { |
5737
|
|
|
errors = append(errors, RelationshipWriteRequestValidationError{ |
5738
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5739
|
|
|
reason: "embedded message failed validation", |
5740
|
|
|
cause: err, |
5741
|
|
|
}) |
5742
|
|
|
} |
5743
|
|
|
} |
5744
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
5745
|
|
|
if err := v.Validate(); err != nil { |
5746
|
|
|
return RelationshipWriteRequestValidationError{ |
5747
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
5748
|
|
|
reason: "embedded message failed validation", |
5749
|
|
|
cause: err, |
5750
|
|
|
} |
5751
|
|
|
} |
5752
|
|
|
} |
5753
|
|
|
|
5754
|
|
|
} |
5755
|
|
|
|
5756
|
|
|
if len(errors) > 0 { |
5757
|
|
|
return RelationshipWriteRequestMultiError(errors) |
5758
|
|
|
} |
5759
|
|
|
|
5760
|
|
|
return nil |
5761
|
|
|
} |
5762
|
|
|
|
5763
|
|
|
// RelationshipWriteRequestMultiError is an error wrapping multiple validation |
5764
|
|
|
// errors returned by RelationshipWriteRequest.ValidateAll() if the designated |
5765
|
|
|
// constraints aren't met. |
5766
|
|
|
type RelationshipWriteRequestMultiError []error |
5767
|
|
|
|
5768
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5769
|
|
|
func (m RelationshipWriteRequestMultiError) Error() string { |
5770
|
|
|
var msgs []string |
5771
|
|
|
for _, err := range m { |
5772
|
|
|
msgs = append(msgs, err.Error()) |
5773
|
|
|
} |
5774
|
|
|
return strings.Join(msgs, "; ") |
5775
|
|
|
} |
5776
|
|
|
|
5777
|
|
|
// AllErrors returns a list of validation violation errors. |
5778
|
|
|
func (m RelationshipWriteRequestMultiError) AllErrors() []error { return m } |
5779
|
|
|
|
5780
|
|
|
// RelationshipWriteRequestValidationError is the validation error returned by |
5781
|
|
|
// RelationshipWriteRequest.Validate if the designated constraints aren't met. |
5782
|
|
|
type RelationshipWriteRequestValidationError struct { |
5783
|
|
|
field string |
5784
|
|
|
reason string |
5785
|
|
|
cause error |
5786
|
|
|
key bool |
5787
|
|
|
} |
5788
|
|
|
|
5789
|
|
|
// Field function returns field value. |
5790
|
|
|
func (e RelationshipWriteRequestValidationError) Field() string { return e.field } |
5791
|
|
|
|
5792
|
|
|
// Reason function returns reason value. |
5793
|
|
|
func (e RelationshipWriteRequestValidationError) Reason() string { return e.reason } |
5794
|
|
|
|
5795
|
|
|
// Cause function returns cause value. |
5796
|
|
|
func (e RelationshipWriteRequestValidationError) Cause() error { return e.cause } |
5797
|
|
|
|
5798
|
|
|
// Key function returns key value. |
5799
|
|
|
func (e RelationshipWriteRequestValidationError) Key() bool { return e.key } |
5800
|
|
|
|
5801
|
|
|
// ErrorName returns error name. |
5802
|
|
|
func (e RelationshipWriteRequestValidationError) ErrorName() string { |
5803
|
|
|
return "RelationshipWriteRequestValidationError" |
5804
|
|
|
} |
5805
|
|
|
|
5806
|
|
|
// Error satisfies the builtin error interface |
5807
|
|
|
func (e RelationshipWriteRequestValidationError) Error() string { |
5808
|
|
|
cause := "" |
5809
|
|
|
if e.cause != nil { |
5810
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5811
|
|
|
} |
5812
|
|
|
|
5813
|
|
|
key := "" |
5814
|
|
|
if e.key { |
5815
|
|
|
key = "key for " |
5816
|
|
|
} |
5817
|
|
|
|
5818
|
|
|
return fmt.Sprintf( |
5819
|
|
|
"invalid %sRelationshipWriteRequest.%s: %s%s", |
5820
|
|
|
key, |
5821
|
|
|
e.field, |
5822
|
|
|
e.reason, |
5823
|
|
|
cause) |
5824
|
|
|
} |
5825
|
|
|
|
5826
|
|
|
var _ error = RelationshipWriteRequestValidationError{} |
5827
|
|
|
|
5828
|
|
|
var _ interface { |
5829
|
|
|
Field() string |
5830
|
|
|
Reason() string |
5831
|
|
|
Key() bool |
5832
|
|
|
Cause() error |
5833
|
|
|
ErrorName() string |
5834
|
|
|
} = RelationshipWriteRequestValidationError{} |
5835
|
|
|
|
5836
|
|
|
var _RelationshipWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
5837
|
|
|
|
5838
|
|
|
// Validate checks the field values on RelationshipWriteRequestMetadata with |
5839
|
|
|
// the rules defined in the proto definition for this message. If any rules |
5840
|
|
|
// are violated, the first error encountered is returned, or nil if there are |
5841
|
|
|
// no violations. |
5842
|
|
|
func (m *RelationshipWriteRequestMetadata) Validate() error { |
5843
|
|
|
return m.validate(false) |
5844
|
|
|
} |
5845
|
|
|
|
5846
|
|
|
// ValidateAll checks the field values on RelationshipWriteRequestMetadata with |
5847
|
|
|
// the rules defined in the proto definition for this message. If any rules |
5848
|
|
|
// are violated, the result is a list of violation errors wrapped in |
5849
|
|
|
// RelationshipWriteRequestMetadataMultiError, or nil if none found. |
5850
|
|
|
func (m *RelationshipWriteRequestMetadata) ValidateAll() error { |
5851
|
|
|
return m.validate(true) |
5852
|
|
|
} |
5853
|
|
|
|
5854
|
|
|
func (m *RelationshipWriteRequestMetadata) validate(all bool) error { |
5855
|
|
|
if m == nil { |
5856
|
|
|
return nil |
5857
|
|
|
} |
5858
|
|
|
|
5859
|
|
|
var errors []error |
5860
|
|
|
|
5861
|
|
|
// no validation rules for SchemaVersion |
5862
|
|
|
|
5863
|
|
|
if len(errors) > 0 { |
5864
|
|
|
return RelationshipWriteRequestMetadataMultiError(errors) |
5865
|
|
|
} |
5866
|
|
|
|
5867
|
|
|
return nil |
5868
|
|
|
} |
5869
|
|
|
|
5870
|
|
|
// RelationshipWriteRequestMetadataMultiError is an error wrapping multiple |
5871
|
|
|
// validation errors returned by |
5872
|
|
|
// RelationshipWriteRequestMetadata.ValidateAll() if the designated |
5873
|
|
|
// constraints aren't met. |
5874
|
|
|
type RelationshipWriteRequestMetadataMultiError []error |
5875
|
|
|
|
5876
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5877
|
|
|
func (m RelationshipWriteRequestMetadataMultiError) Error() string { |
5878
|
|
|
var msgs []string |
5879
|
|
|
for _, err := range m { |
5880
|
|
|
msgs = append(msgs, err.Error()) |
5881
|
|
|
} |
5882
|
|
|
return strings.Join(msgs, "; ") |
5883
|
|
|
} |
5884
|
|
|
|
5885
|
|
|
// AllErrors returns a list of validation violation errors. |
5886
|
|
|
func (m RelationshipWriteRequestMetadataMultiError) AllErrors() []error { return m } |
5887
|
|
|
|
5888
|
|
|
// RelationshipWriteRequestMetadataValidationError is the validation error |
5889
|
|
|
// returned by RelationshipWriteRequestMetadata.Validate if the designated |
5890
|
|
|
// constraints aren't met. |
5891
|
|
|
type RelationshipWriteRequestMetadataValidationError struct { |
5892
|
|
|
field string |
5893
|
|
|
reason string |
5894
|
|
|
cause error |
5895
|
|
|
key bool |
5896
|
|
|
} |
5897
|
|
|
|
5898
|
|
|
// Field function returns field value. |
5899
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Field() string { return e.field } |
5900
|
|
|
|
5901
|
|
|
// Reason function returns reason value. |
5902
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Reason() string { return e.reason } |
5903
|
|
|
|
5904
|
|
|
// Cause function returns cause value. |
5905
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Cause() error { return e.cause } |
5906
|
|
|
|
5907
|
|
|
// Key function returns key value. |
5908
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Key() bool { return e.key } |
5909
|
|
|
|
5910
|
|
|
// ErrorName returns error name. |
5911
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) ErrorName() string { |
5912
|
|
|
return "RelationshipWriteRequestMetadataValidationError" |
5913
|
|
|
} |
5914
|
|
|
|
5915
|
|
|
// Error satisfies the builtin error interface |
5916
|
|
|
func (e RelationshipWriteRequestMetadataValidationError) Error() string { |
5917
|
|
|
cause := "" |
5918
|
|
|
if e.cause != nil { |
5919
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
5920
|
|
|
} |
5921
|
|
|
|
5922
|
|
|
key := "" |
5923
|
|
|
if e.key { |
5924
|
|
|
key = "key for " |
5925
|
|
|
} |
5926
|
|
|
|
5927
|
|
|
return fmt.Sprintf( |
5928
|
|
|
"invalid %sRelationshipWriteRequestMetadata.%s: %s%s", |
5929
|
|
|
key, |
5930
|
|
|
e.field, |
5931
|
|
|
e.reason, |
5932
|
|
|
cause) |
5933
|
|
|
} |
5934
|
|
|
|
5935
|
|
|
var _ error = RelationshipWriteRequestMetadataValidationError{} |
5936
|
|
|
|
5937
|
|
|
var _ interface { |
5938
|
|
|
Field() string |
5939
|
|
|
Reason() string |
5940
|
|
|
Key() bool |
5941
|
|
|
Cause() error |
5942
|
|
|
ErrorName() string |
5943
|
|
|
} = RelationshipWriteRequestMetadataValidationError{} |
5944
|
|
|
|
5945
|
|
|
// Validate checks the field values on RelationshipWriteResponse with the rules |
5946
|
|
|
// defined in the proto definition for this message. If any rules are |
5947
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
5948
|
|
|
func (m *RelationshipWriteResponse) Validate() error { |
5949
|
|
|
return m.validate(false) |
5950
|
|
|
} |
5951
|
|
|
|
5952
|
|
|
// ValidateAll checks the field values on RelationshipWriteResponse with the |
5953
|
|
|
// rules defined in the proto definition for this message. If any rules are |
5954
|
|
|
// violated, the result is a list of violation errors wrapped in |
5955
|
|
|
// RelationshipWriteResponseMultiError, or nil if none found. |
5956
|
|
|
func (m *RelationshipWriteResponse) ValidateAll() error { |
5957
|
|
|
return m.validate(true) |
5958
|
|
|
} |
5959
|
|
|
|
5960
|
|
|
func (m *RelationshipWriteResponse) validate(all bool) error { |
5961
|
|
|
if m == nil { |
5962
|
|
|
return nil |
5963
|
|
|
} |
5964
|
|
|
|
5965
|
|
|
var errors []error |
5966
|
|
|
|
5967
|
|
|
// no validation rules for SnapToken |
5968
|
|
|
|
5969
|
|
|
if len(errors) > 0 { |
5970
|
|
|
return RelationshipWriteResponseMultiError(errors) |
5971
|
|
|
} |
5972
|
|
|
|
5973
|
|
|
return nil |
5974
|
|
|
} |
5975
|
|
|
|
5976
|
|
|
// RelationshipWriteResponseMultiError is an error wrapping multiple validation |
5977
|
|
|
// errors returned by RelationshipWriteResponse.ValidateAll() if the |
5978
|
|
|
// designated constraints aren't met. |
5979
|
|
|
type RelationshipWriteResponseMultiError []error |
5980
|
|
|
|
5981
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
5982
|
|
|
func (m RelationshipWriteResponseMultiError) Error() string { |
5983
|
|
|
var msgs []string |
5984
|
|
|
for _, err := range m { |
5985
|
|
|
msgs = append(msgs, err.Error()) |
5986
|
|
|
} |
5987
|
|
|
return strings.Join(msgs, "; ") |
5988
|
|
|
} |
5989
|
|
|
|
5990
|
|
|
// AllErrors returns a list of validation violation errors. |
5991
|
|
|
func (m RelationshipWriteResponseMultiError) AllErrors() []error { return m } |
5992
|
|
|
|
5993
|
|
|
// RelationshipWriteResponseValidationError is the validation error returned by |
5994
|
|
|
// RelationshipWriteResponse.Validate if the designated constraints aren't met. |
5995
|
|
|
type RelationshipWriteResponseValidationError struct { |
5996
|
|
|
field string |
5997
|
|
|
reason string |
5998
|
|
|
cause error |
5999
|
|
|
key bool |
6000
|
|
|
} |
6001
|
|
|
|
6002
|
|
|
// Field function returns field value. |
6003
|
|
|
func (e RelationshipWriteResponseValidationError) Field() string { return e.field } |
6004
|
|
|
|
6005
|
|
|
// Reason function returns reason value. |
6006
|
|
|
func (e RelationshipWriteResponseValidationError) Reason() string { return e.reason } |
6007
|
|
|
|
6008
|
|
|
// Cause function returns cause value. |
6009
|
|
|
func (e RelationshipWriteResponseValidationError) Cause() error { return e.cause } |
6010
|
|
|
|
6011
|
|
|
// Key function returns key value. |
6012
|
|
|
func (e RelationshipWriteResponseValidationError) Key() bool { return e.key } |
6013
|
|
|
|
6014
|
|
|
// ErrorName returns error name. |
6015
|
|
|
func (e RelationshipWriteResponseValidationError) ErrorName() string { |
6016
|
|
|
return "RelationshipWriteResponseValidationError" |
6017
|
|
|
} |
6018
|
|
|
|
6019
|
|
|
// Error satisfies the builtin error interface |
6020
|
|
|
func (e RelationshipWriteResponseValidationError) Error() string { |
6021
|
|
|
cause := "" |
6022
|
|
|
if e.cause != nil { |
6023
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6024
|
|
|
} |
6025
|
|
|
|
6026
|
|
|
key := "" |
6027
|
|
|
if e.key { |
6028
|
|
|
key = "key for " |
6029
|
|
|
} |
6030
|
|
|
|
6031
|
|
|
return fmt.Sprintf( |
6032
|
|
|
"invalid %sRelationshipWriteResponse.%s: %s%s", |
6033
|
|
|
key, |
6034
|
|
|
e.field, |
6035
|
|
|
e.reason, |
6036
|
|
|
cause) |
6037
|
|
|
} |
6038
|
|
|
|
6039
|
|
|
var _ error = RelationshipWriteResponseValidationError{} |
6040
|
|
|
|
6041
|
|
|
var _ interface { |
6042
|
|
|
Field() string |
6043
|
|
|
Reason() string |
6044
|
|
|
Key() bool |
6045
|
|
|
Cause() error |
6046
|
|
|
ErrorName() string |
6047
|
|
|
} = RelationshipWriteResponseValidationError{} |
6048
|
|
|
|
6049
|
|
|
// Validate checks the field values on RelationshipReadRequest with the rules |
6050
|
|
|
// defined in the proto definition for this message. If any rules are |
6051
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6052
|
|
|
func (m *RelationshipReadRequest) Validate() error { |
6053
|
|
|
return m.validate(false) |
6054
|
|
|
} |
6055
|
|
|
|
6056
|
|
|
// ValidateAll checks the field values on RelationshipReadRequest with the |
6057
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6058
|
|
|
// violated, the result is a list of violation errors wrapped in |
6059
|
|
|
// RelationshipReadRequestMultiError, or nil if none found. |
6060
|
|
|
func (m *RelationshipReadRequest) ValidateAll() error { |
6061
|
|
|
return m.validate(true) |
6062
|
|
|
} |
6063
|
|
|
|
6064
|
|
|
func (m *RelationshipReadRequest) validate(all bool) error { |
6065
|
|
|
if m == nil { |
6066
|
|
|
return nil |
6067
|
|
|
} |
6068
|
|
|
|
6069
|
|
|
var errors []error |
6070
|
|
|
|
6071
|
|
|
if len(m.GetTenantId()) > 128 { |
6072
|
|
|
err := RelationshipReadRequestValidationError{ |
6073
|
|
|
field: "TenantId", |
6074
|
|
|
reason: "value length must be at most 128 bytes", |
6075
|
|
|
} |
6076
|
|
|
if !all { |
6077
|
|
|
return err |
6078
|
|
|
} |
6079
|
|
|
errors = append(errors, err) |
6080
|
|
|
} |
6081
|
|
|
|
6082
|
|
|
if !_RelationshipReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
6083
|
|
|
err := RelationshipReadRequestValidationError{ |
6084
|
|
|
field: "TenantId", |
6085
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
6086
|
|
|
} |
6087
|
|
|
if !all { |
6088
|
|
|
return err |
6089
|
|
|
} |
6090
|
|
|
errors = append(errors, err) |
6091
|
|
|
} |
6092
|
|
|
|
6093
|
|
|
if m.GetMetadata() == nil { |
6094
|
|
|
err := RelationshipReadRequestValidationError{ |
6095
|
|
|
field: "Metadata", |
6096
|
|
|
reason: "value is required", |
6097
|
|
|
} |
6098
|
|
|
if !all { |
6099
|
|
|
return err |
6100
|
|
|
} |
6101
|
|
|
errors = append(errors, err) |
6102
|
|
|
} |
6103
|
|
|
|
6104
|
|
|
if all { |
6105
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
6106
|
|
|
case interface{ ValidateAll() error }: |
6107
|
|
|
if err := v.ValidateAll(); err != nil { |
6108
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6109
|
|
|
field: "Metadata", |
6110
|
|
|
reason: "embedded message failed validation", |
6111
|
|
|
cause: err, |
6112
|
|
|
}) |
6113
|
|
|
} |
6114
|
|
|
case interface{ Validate() error }: |
6115
|
|
|
if err := v.Validate(); err != nil { |
6116
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6117
|
|
|
field: "Metadata", |
6118
|
|
|
reason: "embedded message failed validation", |
6119
|
|
|
cause: err, |
6120
|
|
|
}) |
6121
|
|
|
} |
6122
|
|
|
} |
6123
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6124
|
|
|
if err := v.Validate(); err != nil { |
6125
|
|
|
return RelationshipReadRequestValidationError{ |
6126
|
|
|
field: "Metadata", |
6127
|
|
|
reason: "embedded message failed validation", |
6128
|
|
|
cause: err, |
6129
|
|
|
} |
6130
|
|
|
} |
6131
|
|
|
} |
6132
|
|
|
|
6133
|
|
|
if m.GetFilter() == nil { |
6134
|
|
|
err := RelationshipReadRequestValidationError{ |
6135
|
|
|
field: "Filter", |
6136
|
|
|
reason: "value is required", |
6137
|
|
|
} |
6138
|
|
|
if !all { |
6139
|
|
|
return err |
6140
|
|
|
} |
6141
|
|
|
errors = append(errors, err) |
6142
|
|
|
} |
6143
|
|
|
|
6144
|
|
|
if all { |
6145
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
6146
|
|
|
case interface{ ValidateAll() error }: |
6147
|
|
|
if err := v.ValidateAll(); err != nil { |
6148
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6149
|
|
|
field: "Filter", |
6150
|
|
|
reason: "embedded message failed validation", |
6151
|
|
|
cause: err, |
6152
|
|
|
}) |
6153
|
|
|
} |
6154
|
|
|
case interface{ Validate() error }: |
6155
|
|
|
if err := v.Validate(); err != nil { |
6156
|
|
|
errors = append(errors, RelationshipReadRequestValidationError{ |
6157
|
|
|
field: "Filter", |
6158
|
|
|
reason: "embedded message failed validation", |
6159
|
|
|
cause: err, |
6160
|
|
|
}) |
6161
|
|
|
} |
6162
|
|
|
} |
6163
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
6164
|
|
|
if err := v.Validate(); err != nil { |
6165
|
|
|
return RelationshipReadRequestValidationError{ |
6166
|
|
|
field: "Filter", |
6167
|
|
|
reason: "embedded message failed validation", |
6168
|
|
|
cause: err, |
6169
|
|
|
} |
6170
|
|
|
} |
6171
|
|
|
} |
6172
|
|
|
|
6173
|
|
|
if m.GetPageSize() != 0 { |
6174
|
|
|
|
6175
|
|
|
if m.GetPageSize() < 1 { |
6176
|
|
|
err := RelationshipReadRequestValidationError{ |
6177
|
|
|
field: "PageSize", |
6178
|
|
|
reason: "value must be greater than or equal to 1", |
6179
|
|
|
} |
6180
|
|
|
if !all { |
6181
|
|
|
return err |
6182
|
|
|
} |
6183
|
|
|
errors = append(errors, err) |
6184
|
|
|
} |
6185
|
|
|
|
6186
|
|
|
} |
6187
|
|
|
|
6188
|
|
|
if m.GetContinuousToken() != "" { |
6189
|
|
|
|
6190
|
|
|
} |
6191
|
|
|
|
6192
|
|
|
if len(errors) > 0 { |
6193
|
|
|
return RelationshipReadRequestMultiError(errors) |
6194
|
|
|
} |
6195
|
|
|
|
6196
|
|
|
return nil |
6197
|
|
|
} |
6198
|
|
|
|
6199
|
|
|
// RelationshipReadRequestMultiError is an error wrapping multiple validation |
6200
|
|
|
// errors returned by RelationshipReadRequest.ValidateAll() if the designated |
6201
|
|
|
// constraints aren't met. |
6202
|
|
|
type RelationshipReadRequestMultiError []error |
6203
|
|
|
|
6204
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6205
|
|
|
func (m RelationshipReadRequestMultiError) Error() string { |
6206
|
|
|
var msgs []string |
6207
|
|
|
for _, err := range m { |
6208
|
|
|
msgs = append(msgs, err.Error()) |
6209
|
|
|
} |
6210
|
|
|
return strings.Join(msgs, "; ") |
6211
|
|
|
} |
6212
|
|
|
|
6213
|
|
|
// AllErrors returns a list of validation violation errors. |
6214
|
|
|
func (m RelationshipReadRequestMultiError) AllErrors() []error { return m } |
6215
|
|
|
|
6216
|
|
|
// RelationshipReadRequestValidationError is the validation error returned by |
6217
|
|
|
// RelationshipReadRequest.Validate if the designated constraints aren't met. |
6218
|
|
|
type RelationshipReadRequestValidationError struct { |
6219
|
|
|
field string |
6220
|
|
|
reason string |
6221
|
|
|
cause error |
6222
|
|
|
key bool |
6223
|
|
|
} |
6224
|
|
|
|
6225
|
|
|
// Field function returns field value. |
6226
|
|
|
func (e RelationshipReadRequestValidationError) Field() string { return e.field } |
6227
|
|
|
|
6228
|
|
|
// Reason function returns reason value. |
6229
|
|
|
func (e RelationshipReadRequestValidationError) Reason() string { return e.reason } |
6230
|
|
|
|
6231
|
|
|
// Cause function returns cause value. |
6232
|
|
|
func (e RelationshipReadRequestValidationError) Cause() error { return e.cause } |
6233
|
|
|
|
6234
|
|
|
// Key function returns key value. |
6235
|
|
|
func (e RelationshipReadRequestValidationError) Key() bool { return e.key } |
6236
|
|
|
|
6237
|
|
|
// ErrorName returns error name. |
6238
|
|
|
func (e RelationshipReadRequestValidationError) ErrorName() string { |
6239
|
|
|
return "RelationshipReadRequestValidationError" |
6240
|
|
|
} |
6241
|
|
|
|
6242
|
|
|
// Error satisfies the builtin error interface |
6243
|
|
|
func (e RelationshipReadRequestValidationError) Error() string { |
6244
|
|
|
cause := "" |
6245
|
|
|
if e.cause != nil { |
6246
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6247
|
|
|
} |
6248
|
|
|
|
6249
|
|
|
key := "" |
6250
|
|
|
if e.key { |
6251
|
|
|
key = "key for " |
6252
|
|
|
} |
6253
|
|
|
|
6254
|
|
|
return fmt.Sprintf( |
6255
|
|
|
"invalid %sRelationshipReadRequest.%s: %s%s", |
6256
|
|
|
key, |
6257
|
|
|
e.field, |
6258
|
|
|
e.reason, |
6259
|
|
|
cause) |
6260
|
|
|
} |
6261
|
|
|
|
6262
|
|
|
var _ error = RelationshipReadRequestValidationError{} |
6263
|
|
|
|
6264
|
|
|
var _ interface { |
6265
|
|
|
Field() string |
6266
|
|
|
Reason() string |
6267
|
|
|
Key() bool |
6268
|
|
|
Cause() error |
6269
|
|
|
ErrorName() string |
6270
|
|
|
} = RelationshipReadRequestValidationError{} |
6271
|
|
|
|
6272
|
|
|
var _RelationshipReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6273
|
|
|
|
6274
|
|
|
// Validate checks the field values on RelationshipReadRequestMetadata with the |
6275
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6276
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6277
|
|
|
func (m *RelationshipReadRequestMetadata) Validate() error { |
6278
|
|
|
return m.validate(false) |
6279
|
|
|
} |
6280
|
|
|
|
6281
|
|
|
// ValidateAll checks the field values on RelationshipReadRequestMetadata with |
6282
|
|
|
// the rules defined in the proto definition for this message. If any rules |
6283
|
|
|
// are violated, the result is a list of violation errors wrapped in |
6284
|
|
|
// RelationshipReadRequestMetadataMultiError, or nil if none found. |
6285
|
|
|
func (m *RelationshipReadRequestMetadata) ValidateAll() error { |
6286
|
|
|
return m.validate(true) |
6287
|
|
|
} |
6288
|
|
|
|
6289
|
|
|
func (m *RelationshipReadRequestMetadata) validate(all bool) error { |
6290
|
|
|
if m == nil { |
6291
|
|
|
return nil |
6292
|
|
|
} |
6293
|
|
|
|
6294
|
|
|
var errors []error |
6295
|
|
|
|
6296
|
|
|
// no validation rules for SnapToken |
6297
|
|
|
|
6298
|
|
|
if len(errors) > 0 { |
6299
|
|
|
return RelationshipReadRequestMetadataMultiError(errors) |
6300
|
|
|
} |
6301
|
|
|
|
6302
|
|
|
return nil |
6303
|
|
|
} |
6304
|
|
|
|
6305
|
|
|
// RelationshipReadRequestMetadataMultiError is an error wrapping multiple |
6306
|
|
|
// validation errors returned by RelationshipReadRequestMetadata.ValidateAll() |
6307
|
|
|
// if the designated constraints aren't met. |
6308
|
|
|
type RelationshipReadRequestMetadataMultiError []error |
6309
|
|
|
|
6310
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6311
|
|
|
func (m RelationshipReadRequestMetadataMultiError) Error() string { |
6312
|
|
|
var msgs []string |
6313
|
|
|
for _, err := range m { |
6314
|
|
|
msgs = append(msgs, err.Error()) |
6315
|
|
|
} |
6316
|
|
|
return strings.Join(msgs, "; ") |
6317
|
|
|
} |
6318
|
|
|
|
6319
|
|
|
// AllErrors returns a list of validation violation errors. |
6320
|
|
|
func (m RelationshipReadRequestMetadataMultiError) AllErrors() []error { return m } |
6321
|
|
|
|
6322
|
|
|
// RelationshipReadRequestMetadataValidationError is the validation error |
6323
|
|
|
// returned by RelationshipReadRequestMetadata.Validate if the designated |
6324
|
|
|
// constraints aren't met. |
6325
|
|
|
type RelationshipReadRequestMetadataValidationError struct { |
6326
|
|
|
field string |
6327
|
|
|
reason string |
6328
|
|
|
cause error |
6329
|
|
|
key bool |
6330
|
|
|
} |
6331
|
|
|
|
6332
|
|
|
// Field function returns field value. |
6333
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Field() string { return e.field } |
6334
|
|
|
|
6335
|
|
|
// Reason function returns reason value. |
6336
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Reason() string { return e.reason } |
6337
|
|
|
|
6338
|
|
|
// Cause function returns cause value. |
6339
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Cause() error { return e.cause } |
6340
|
|
|
|
6341
|
|
|
// Key function returns key value. |
6342
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Key() bool { return e.key } |
6343
|
|
|
|
6344
|
|
|
// ErrorName returns error name. |
6345
|
|
|
func (e RelationshipReadRequestMetadataValidationError) ErrorName() string { |
6346
|
|
|
return "RelationshipReadRequestMetadataValidationError" |
6347
|
|
|
} |
6348
|
|
|
|
6349
|
|
|
// Error satisfies the builtin error interface |
6350
|
|
|
func (e RelationshipReadRequestMetadataValidationError) Error() string { |
6351
|
|
|
cause := "" |
6352
|
|
|
if e.cause != nil { |
6353
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6354
|
|
|
} |
6355
|
|
|
|
6356
|
|
|
key := "" |
6357
|
|
|
if e.key { |
6358
|
|
|
key = "key for " |
6359
|
|
|
} |
6360
|
|
|
|
6361
|
|
|
return fmt.Sprintf( |
6362
|
|
|
"invalid %sRelationshipReadRequestMetadata.%s: %s%s", |
6363
|
|
|
key, |
6364
|
|
|
e.field, |
6365
|
|
|
e.reason, |
6366
|
|
|
cause) |
6367
|
|
|
} |
6368
|
|
|
|
6369
|
|
|
var _ error = RelationshipReadRequestMetadataValidationError{} |
6370
|
|
|
|
6371
|
|
|
var _ interface { |
6372
|
|
|
Field() string |
6373
|
|
|
Reason() string |
6374
|
|
|
Key() bool |
6375
|
|
|
Cause() error |
6376
|
|
|
ErrorName() string |
6377
|
|
|
} = RelationshipReadRequestMetadataValidationError{} |
6378
|
|
|
|
6379
|
|
|
// Validate checks the field values on RelationshipReadResponse with the rules |
6380
|
|
|
// defined in the proto definition for this message. If any rules are |
6381
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6382
|
|
|
func (m *RelationshipReadResponse) Validate() error { |
6383
|
|
|
return m.validate(false) |
6384
|
|
|
} |
6385
|
|
|
|
6386
|
|
|
// ValidateAll checks the field values on RelationshipReadResponse with the |
6387
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6388
|
|
|
// violated, the result is a list of violation errors wrapped in |
6389
|
|
|
// RelationshipReadResponseMultiError, or nil if none found. |
6390
|
|
|
func (m *RelationshipReadResponse) ValidateAll() error { |
6391
|
|
|
return m.validate(true) |
6392
|
|
|
} |
6393
|
|
|
|
6394
|
|
|
func (m *RelationshipReadResponse) validate(all bool) error { |
6395
|
|
|
if m == nil { |
6396
|
|
|
return nil |
6397
|
|
|
} |
6398
|
|
|
|
6399
|
|
|
var errors []error |
6400
|
|
|
|
6401
|
|
|
for idx, item := range m.GetTuples() { |
6402
|
|
|
_, _ = idx, item |
6403
|
|
|
|
6404
|
|
|
if all { |
6405
|
|
|
switch v := interface{}(item).(type) { |
6406
|
|
|
case interface{ ValidateAll() error }: |
6407
|
|
|
if err := v.ValidateAll(); err != nil { |
6408
|
|
|
errors = append(errors, RelationshipReadResponseValidationError{ |
6409
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6410
|
|
|
reason: "embedded message failed validation", |
6411
|
|
|
cause: err, |
6412
|
|
|
}) |
6413
|
|
|
} |
6414
|
|
|
case interface{ Validate() error }: |
6415
|
|
|
if err := v.Validate(); err != nil { |
6416
|
|
|
errors = append(errors, RelationshipReadResponseValidationError{ |
6417
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6418
|
|
|
reason: "embedded message failed validation", |
6419
|
|
|
cause: err, |
6420
|
|
|
}) |
6421
|
|
|
} |
6422
|
|
|
} |
6423
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6424
|
|
|
if err := v.Validate(); err != nil { |
6425
|
|
|
return RelationshipReadResponseValidationError{ |
6426
|
|
|
field: fmt.Sprintf("Tuples[%v]", idx), |
6427
|
|
|
reason: "embedded message failed validation", |
6428
|
|
|
cause: err, |
6429
|
|
|
} |
6430
|
|
|
} |
6431
|
|
|
} |
6432
|
|
|
|
6433
|
|
|
} |
6434
|
|
|
|
6435
|
|
|
// no validation rules for ContinuousToken |
6436
|
|
|
|
6437
|
|
|
if len(errors) > 0 { |
6438
|
|
|
return RelationshipReadResponseMultiError(errors) |
6439
|
|
|
} |
6440
|
|
|
|
6441
|
|
|
return nil |
6442
|
|
|
} |
6443
|
|
|
|
6444
|
|
|
// RelationshipReadResponseMultiError is an error wrapping multiple validation |
6445
|
|
|
// errors returned by RelationshipReadResponse.ValidateAll() if the designated |
6446
|
|
|
// constraints aren't met. |
6447
|
|
|
type RelationshipReadResponseMultiError []error |
6448
|
|
|
|
6449
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6450
|
|
|
func (m RelationshipReadResponseMultiError) Error() string { |
6451
|
|
|
var msgs []string |
6452
|
|
|
for _, err := range m { |
6453
|
|
|
msgs = append(msgs, err.Error()) |
6454
|
|
|
} |
6455
|
|
|
return strings.Join(msgs, "; ") |
6456
|
|
|
} |
6457
|
|
|
|
6458
|
|
|
// AllErrors returns a list of validation violation errors. |
6459
|
|
|
func (m RelationshipReadResponseMultiError) AllErrors() []error { return m } |
6460
|
|
|
|
6461
|
|
|
// RelationshipReadResponseValidationError is the validation error returned by |
6462
|
|
|
// RelationshipReadResponse.Validate if the designated constraints aren't met. |
6463
|
|
|
type RelationshipReadResponseValidationError struct { |
6464
|
|
|
field string |
6465
|
|
|
reason string |
6466
|
|
|
cause error |
6467
|
|
|
key bool |
6468
|
|
|
} |
6469
|
|
|
|
6470
|
|
|
// Field function returns field value. |
6471
|
|
|
func (e RelationshipReadResponseValidationError) Field() string { return e.field } |
6472
|
|
|
|
6473
|
|
|
// Reason function returns reason value. |
6474
|
|
|
func (e RelationshipReadResponseValidationError) Reason() string { return e.reason } |
6475
|
|
|
|
6476
|
|
|
// Cause function returns cause value. |
6477
|
|
|
func (e RelationshipReadResponseValidationError) Cause() error { return e.cause } |
6478
|
|
|
|
6479
|
|
|
// Key function returns key value. |
6480
|
|
|
func (e RelationshipReadResponseValidationError) Key() bool { return e.key } |
6481
|
|
|
|
6482
|
|
|
// ErrorName returns error name. |
6483
|
|
|
func (e RelationshipReadResponseValidationError) ErrorName() string { |
6484
|
|
|
return "RelationshipReadResponseValidationError" |
6485
|
|
|
} |
6486
|
|
|
|
6487
|
|
|
// Error satisfies the builtin error interface |
6488
|
|
|
func (e RelationshipReadResponseValidationError) Error() string { |
6489
|
|
|
cause := "" |
6490
|
|
|
if e.cause != nil { |
6491
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6492
|
|
|
} |
6493
|
|
|
|
6494
|
|
|
key := "" |
6495
|
|
|
if e.key { |
6496
|
|
|
key = "key for " |
6497
|
|
|
} |
6498
|
|
|
|
6499
|
|
|
return fmt.Sprintf( |
6500
|
|
|
"invalid %sRelationshipReadResponse.%s: %s%s", |
6501
|
|
|
key, |
6502
|
|
|
e.field, |
6503
|
|
|
e.reason, |
6504
|
|
|
cause) |
6505
|
|
|
} |
6506
|
|
|
|
6507
|
|
|
var _ error = RelationshipReadResponseValidationError{} |
6508
|
|
|
|
6509
|
|
|
var _ interface { |
6510
|
|
|
Field() string |
6511
|
|
|
Reason() string |
6512
|
|
|
Key() bool |
6513
|
|
|
Cause() error |
6514
|
|
|
ErrorName() string |
6515
|
|
|
} = RelationshipReadResponseValidationError{} |
6516
|
|
|
|
6517
|
|
|
// Validate checks the field values on AttributeReadRequest with the rules |
6518
|
|
|
// defined in the proto definition for this message. If any rules are |
6519
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6520
|
|
|
func (m *AttributeReadRequest) Validate() error { |
6521
|
|
|
return m.validate(false) |
6522
|
|
|
} |
6523
|
|
|
|
6524
|
|
|
// ValidateAll checks the field values on AttributeReadRequest with the rules |
6525
|
|
|
// defined in the proto definition for this message. If any rules are |
6526
|
|
|
// violated, the result is a list of violation errors wrapped in |
6527
|
|
|
// AttributeReadRequestMultiError, or nil if none found. |
6528
|
|
|
func (m *AttributeReadRequest) ValidateAll() error { |
6529
|
|
|
return m.validate(true) |
6530
|
|
|
} |
6531
|
|
|
|
6532
|
|
|
func (m *AttributeReadRequest) validate(all bool) error { |
6533
|
|
|
if m == nil { |
6534
|
|
|
return nil |
6535
|
|
|
} |
6536
|
|
|
|
6537
|
|
|
var errors []error |
6538
|
|
|
|
6539
|
|
|
if len(m.GetTenantId()) > 128 { |
6540
|
|
|
err := AttributeReadRequestValidationError{ |
6541
|
|
|
field: "TenantId", |
6542
|
|
|
reason: "value length must be at most 128 bytes", |
6543
|
|
|
} |
6544
|
|
|
if !all { |
6545
|
|
|
return err |
6546
|
|
|
} |
6547
|
|
|
errors = append(errors, err) |
6548
|
|
|
} |
6549
|
|
|
|
6550
|
|
|
if !_AttributeReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
6551
|
|
|
err := AttributeReadRequestValidationError{ |
6552
|
|
|
field: "TenantId", |
6553
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
6554
|
|
|
} |
6555
|
|
|
if !all { |
6556
|
|
|
return err |
6557
|
|
|
} |
6558
|
|
|
errors = append(errors, err) |
6559
|
|
|
} |
6560
|
|
|
|
6561
|
|
|
if m.GetMetadata() == nil { |
6562
|
|
|
err := AttributeReadRequestValidationError{ |
6563
|
|
|
field: "Metadata", |
6564
|
|
|
reason: "value is required", |
6565
|
|
|
} |
6566
|
|
|
if !all { |
6567
|
|
|
return err |
6568
|
|
|
} |
6569
|
|
|
errors = append(errors, err) |
6570
|
|
|
} |
6571
|
|
|
|
6572
|
|
|
if all { |
6573
|
|
|
switch v := interface{}(m.GetMetadata()).(type) { |
6574
|
|
|
case interface{ ValidateAll() error }: |
6575
|
|
|
if err := v.ValidateAll(); err != nil { |
6576
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
6577
|
|
|
field: "Metadata", |
6578
|
|
|
reason: "embedded message failed validation", |
6579
|
|
|
cause: err, |
6580
|
|
|
}) |
6581
|
|
|
} |
6582
|
|
|
case interface{ Validate() error }: |
6583
|
|
|
if err := v.Validate(); err != nil { |
6584
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
6585
|
|
|
field: "Metadata", |
6586
|
|
|
reason: "embedded message failed validation", |
6587
|
|
|
cause: err, |
6588
|
|
|
}) |
6589
|
|
|
} |
6590
|
|
|
} |
6591
|
|
|
} else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { |
6592
|
|
|
if err := v.Validate(); err != nil { |
6593
|
|
|
return AttributeReadRequestValidationError{ |
6594
|
|
|
field: "Metadata", |
6595
|
|
|
reason: "embedded message failed validation", |
6596
|
|
|
cause: err, |
6597
|
|
|
} |
6598
|
|
|
} |
6599
|
|
|
} |
6600
|
|
|
|
6601
|
|
|
if m.GetFilter() == nil { |
6602
|
|
|
err := AttributeReadRequestValidationError{ |
6603
|
|
|
field: "Filter", |
6604
|
|
|
reason: "value is required", |
6605
|
|
|
} |
6606
|
|
|
if !all { |
6607
|
|
|
return err |
6608
|
|
|
} |
6609
|
|
|
errors = append(errors, err) |
6610
|
|
|
} |
6611
|
|
|
|
6612
|
|
|
if all { |
6613
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
6614
|
|
|
case interface{ ValidateAll() error }: |
6615
|
|
|
if err := v.ValidateAll(); err != nil { |
6616
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
6617
|
|
|
field: "Filter", |
6618
|
|
|
reason: "embedded message failed validation", |
6619
|
|
|
cause: err, |
6620
|
|
|
}) |
6621
|
|
|
} |
6622
|
|
|
case interface{ Validate() error }: |
6623
|
|
|
if err := v.Validate(); err != nil { |
6624
|
|
|
errors = append(errors, AttributeReadRequestValidationError{ |
6625
|
|
|
field: "Filter", |
6626
|
|
|
reason: "embedded message failed validation", |
6627
|
|
|
cause: err, |
6628
|
|
|
}) |
6629
|
|
|
} |
6630
|
|
|
} |
6631
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
6632
|
|
|
if err := v.Validate(); err != nil { |
6633
|
|
|
return AttributeReadRequestValidationError{ |
6634
|
|
|
field: "Filter", |
6635
|
|
|
reason: "embedded message failed validation", |
6636
|
|
|
cause: err, |
6637
|
|
|
} |
6638
|
|
|
} |
6639
|
|
|
} |
6640
|
|
|
|
6641
|
|
|
if m.GetPageSize() != 0 { |
6642
|
|
|
|
6643
|
|
|
if m.GetPageSize() < 1 { |
6644
|
|
|
err := AttributeReadRequestValidationError{ |
6645
|
|
|
field: "PageSize", |
6646
|
|
|
reason: "value must be greater than or equal to 1", |
6647
|
|
|
} |
6648
|
|
|
if !all { |
6649
|
|
|
return err |
6650
|
|
|
} |
6651
|
|
|
errors = append(errors, err) |
6652
|
|
|
} |
6653
|
|
|
|
6654
|
|
|
} |
6655
|
|
|
|
6656
|
|
|
if m.GetContinuousToken() != "" { |
6657
|
|
|
|
6658
|
|
|
} |
6659
|
|
|
|
6660
|
|
|
if len(errors) > 0 { |
6661
|
|
|
return AttributeReadRequestMultiError(errors) |
6662
|
|
|
} |
6663
|
|
|
|
6664
|
|
|
return nil |
6665
|
|
|
} |
6666
|
|
|
|
6667
|
|
|
// AttributeReadRequestMultiError is an error wrapping multiple validation |
6668
|
|
|
// errors returned by AttributeReadRequest.ValidateAll() if the designated |
6669
|
|
|
// constraints aren't met. |
6670
|
|
|
type AttributeReadRequestMultiError []error |
6671
|
|
|
|
6672
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6673
|
|
|
func (m AttributeReadRequestMultiError) Error() string { |
6674
|
|
|
var msgs []string |
6675
|
|
|
for _, err := range m { |
6676
|
|
|
msgs = append(msgs, err.Error()) |
6677
|
|
|
} |
6678
|
|
|
return strings.Join(msgs, "; ") |
6679
|
|
|
} |
6680
|
|
|
|
6681
|
|
|
// AllErrors returns a list of validation violation errors. |
6682
|
|
|
func (m AttributeReadRequestMultiError) AllErrors() []error { return m } |
6683
|
|
|
|
6684
|
|
|
// AttributeReadRequestValidationError is the validation error returned by |
6685
|
|
|
// AttributeReadRequest.Validate if the designated constraints aren't met. |
6686
|
|
|
type AttributeReadRequestValidationError struct { |
6687
|
|
|
field string |
6688
|
|
|
reason string |
6689
|
|
|
cause error |
6690
|
|
|
key bool |
6691
|
|
|
} |
6692
|
|
|
|
6693
|
|
|
// Field function returns field value. |
6694
|
|
|
func (e AttributeReadRequestValidationError) Field() string { return e.field } |
6695
|
|
|
|
6696
|
|
|
// Reason function returns reason value. |
6697
|
|
|
func (e AttributeReadRequestValidationError) Reason() string { return e.reason } |
6698
|
|
|
|
6699
|
|
|
// Cause function returns cause value. |
6700
|
|
|
func (e AttributeReadRequestValidationError) Cause() error { return e.cause } |
6701
|
|
|
|
6702
|
|
|
// Key function returns key value. |
6703
|
|
|
func (e AttributeReadRequestValidationError) Key() bool { return e.key } |
6704
|
|
|
|
6705
|
|
|
// ErrorName returns error name. |
6706
|
|
|
func (e AttributeReadRequestValidationError) ErrorName() string { |
6707
|
|
|
return "AttributeReadRequestValidationError" |
6708
|
|
|
} |
6709
|
|
|
|
6710
|
|
|
// Error satisfies the builtin error interface |
6711
|
|
|
func (e AttributeReadRequestValidationError) Error() string { |
6712
|
|
|
cause := "" |
6713
|
|
|
if e.cause != nil { |
6714
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6715
|
|
|
} |
6716
|
|
|
|
6717
|
|
|
key := "" |
6718
|
|
|
if e.key { |
6719
|
|
|
key = "key for " |
6720
|
|
|
} |
6721
|
|
|
|
6722
|
|
|
return fmt.Sprintf( |
6723
|
|
|
"invalid %sAttributeReadRequest.%s: %s%s", |
6724
|
|
|
key, |
6725
|
|
|
e.field, |
6726
|
|
|
e.reason, |
6727
|
|
|
cause) |
6728
|
|
|
} |
6729
|
|
|
|
6730
|
|
|
var _ error = AttributeReadRequestValidationError{} |
6731
|
|
|
|
6732
|
|
|
var _ interface { |
6733
|
|
|
Field() string |
6734
|
|
|
Reason() string |
6735
|
|
|
Key() bool |
6736
|
|
|
Cause() error |
6737
|
|
|
ErrorName() string |
6738
|
|
|
} = AttributeReadRequestValidationError{} |
6739
|
|
|
|
6740
|
|
|
var _AttributeReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
6741
|
|
|
|
6742
|
|
|
// Validate checks the field values on AttributeReadRequestMetadata with the |
6743
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6744
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6745
|
|
|
func (m *AttributeReadRequestMetadata) Validate() error { |
6746
|
|
|
return m.validate(false) |
6747
|
|
|
} |
6748
|
|
|
|
6749
|
|
|
// ValidateAll checks the field values on AttributeReadRequestMetadata with the |
6750
|
|
|
// rules defined in the proto definition for this message. If any rules are |
6751
|
|
|
// violated, the result is a list of violation errors wrapped in |
6752
|
|
|
// AttributeReadRequestMetadataMultiError, or nil if none found. |
6753
|
|
|
func (m *AttributeReadRequestMetadata) ValidateAll() error { |
6754
|
|
|
return m.validate(true) |
6755
|
|
|
} |
6756
|
|
|
|
6757
|
|
|
func (m *AttributeReadRequestMetadata) validate(all bool) error { |
6758
|
|
|
if m == nil { |
6759
|
|
|
return nil |
6760
|
|
|
} |
6761
|
|
|
|
6762
|
|
|
var errors []error |
6763
|
|
|
|
6764
|
|
|
// no validation rules for SnapToken |
6765
|
|
|
|
6766
|
|
|
if len(errors) > 0 { |
6767
|
|
|
return AttributeReadRequestMetadataMultiError(errors) |
6768
|
|
|
} |
6769
|
|
|
|
6770
|
|
|
return nil |
6771
|
|
|
} |
6772
|
|
|
|
6773
|
|
|
// AttributeReadRequestMetadataMultiError is an error wrapping multiple |
6774
|
|
|
// validation errors returned by AttributeReadRequestMetadata.ValidateAll() if |
6775
|
|
|
// the designated constraints aren't met. |
6776
|
|
|
type AttributeReadRequestMetadataMultiError []error |
6777
|
|
|
|
6778
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6779
|
|
|
func (m AttributeReadRequestMetadataMultiError) Error() string { |
6780
|
|
|
var msgs []string |
6781
|
|
|
for _, err := range m { |
6782
|
|
|
msgs = append(msgs, err.Error()) |
6783
|
|
|
} |
6784
|
|
|
return strings.Join(msgs, "; ") |
6785
|
|
|
} |
6786
|
|
|
|
6787
|
|
|
// AllErrors returns a list of validation violation errors. |
6788
|
|
|
func (m AttributeReadRequestMetadataMultiError) AllErrors() []error { return m } |
6789
|
|
|
|
6790
|
|
|
// AttributeReadRequestMetadataValidationError is the validation error returned |
6791
|
|
|
// by AttributeReadRequestMetadata.Validate if the designated constraints |
6792
|
|
|
// aren't met. |
6793
|
|
|
type AttributeReadRequestMetadataValidationError struct { |
6794
|
|
|
field string |
6795
|
|
|
reason string |
6796
|
|
|
cause error |
6797
|
|
|
key bool |
6798
|
|
|
} |
6799
|
|
|
|
6800
|
|
|
// Field function returns field value. |
6801
|
|
|
func (e AttributeReadRequestMetadataValidationError) Field() string { return e.field } |
6802
|
|
|
|
6803
|
|
|
// Reason function returns reason value. |
6804
|
|
|
func (e AttributeReadRequestMetadataValidationError) Reason() string { return e.reason } |
6805
|
|
|
|
6806
|
|
|
// Cause function returns cause value. |
6807
|
|
|
func (e AttributeReadRequestMetadataValidationError) Cause() error { return e.cause } |
6808
|
|
|
|
6809
|
|
|
// Key function returns key value. |
6810
|
|
|
func (e AttributeReadRequestMetadataValidationError) Key() bool { return e.key } |
6811
|
|
|
|
6812
|
|
|
// ErrorName returns error name. |
6813
|
|
|
func (e AttributeReadRequestMetadataValidationError) ErrorName() string { |
6814
|
|
|
return "AttributeReadRequestMetadataValidationError" |
6815
|
|
|
} |
6816
|
|
|
|
6817
|
|
|
// Error satisfies the builtin error interface |
6818
|
|
|
func (e AttributeReadRequestMetadataValidationError) Error() string { |
6819
|
|
|
cause := "" |
6820
|
|
|
if e.cause != nil { |
6821
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6822
|
|
|
} |
6823
|
|
|
|
6824
|
|
|
key := "" |
6825
|
|
|
if e.key { |
6826
|
|
|
key = "key for " |
6827
|
|
|
} |
6828
|
|
|
|
6829
|
|
|
return fmt.Sprintf( |
6830
|
|
|
"invalid %sAttributeReadRequestMetadata.%s: %s%s", |
6831
|
|
|
key, |
6832
|
|
|
e.field, |
6833
|
|
|
e.reason, |
6834
|
|
|
cause) |
6835
|
|
|
} |
6836
|
|
|
|
6837
|
|
|
var _ error = AttributeReadRequestMetadataValidationError{} |
6838
|
|
|
|
6839
|
|
|
var _ interface { |
6840
|
|
|
Field() string |
6841
|
|
|
Reason() string |
6842
|
|
|
Key() bool |
6843
|
|
|
Cause() error |
6844
|
|
|
ErrorName() string |
6845
|
|
|
} = AttributeReadRequestMetadataValidationError{} |
6846
|
|
|
|
6847
|
|
|
// Validate checks the field values on AttributeReadResponse with the rules |
6848
|
|
|
// defined in the proto definition for this message. If any rules are |
6849
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
6850
|
|
|
func (m *AttributeReadResponse) Validate() error { |
6851
|
|
|
return m.validate(false) |
6852
|
|
|
} |
6853
|
|
|
|
6854
|
|
|
// ValidateAll checks the field values on AttributeReadResponse with the rules |
6855
|
|
|
// defined in the proto definition for this message. If any rules are |
6856
|
|
|
// violated, the result is a list of violation errors wrapped in |
6857
|
|
|
// AttributeReadResponseMultiError, or nil if none found. |
6858
|
|
|
func (m *AttributeReadResponse) ValidateAll() error { |
6859
|
|
|
return m.validate(true) |
6860
|
|
|
} |
6861
|
|
|
|
6862
|
|
|
func (m *AttributeReadResponse) validate(all bool) error { |
6863
|
|
|
if m == nil { |
6864
|
|
|
return nil |
6865
|
|
|
} |
6866
|
|
|
|
6867
|
|
|
var errors []error |
6868
|
|
|
|
6869
|
|
|
for idx, item := range m.GetAttributes() { |
6870
|
|
|
_, _ = idx, item |
6871
|
|
|
|
6872
|
|
|
if all { |
6873
|
|
|
switch v := interface{}(item).(type) { |
6874
|
|
|
case interface{ ValidateAll() error }: |
6875
|
|
|
if err := v.ValidateAll(); err != nil { |
6876
|
|
|
errors = append(errors, AttributeReadResponseValidationError{ |
6877
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6878
|
|
|
reason: "embedded message failed validation", |
6879
|
|
|
cause: err, |
6880
|
|
|
}) |
6881
|
|
|
} |
6882
|
|
|
case interface{ Validate() error }: |
6883
|
|
|
if err := v.Validate(); err != nil { |
6884
|
|
|
errors = append(errors, AttributeReadResponseValidationError{ |
6885
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6886
|
|
|
reason: "embedded message failed validation", |
6887
|
|
|
cause: err, |
6888
|
|
|
}) |
6889
|
|
|
} |
6890
|
|
|
} |
6891
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
6892
|
|
|
if err := v.Validate(); err != nil { |
6893
|
|
|
return AttributeReadResponseValidationError{ |
6894
|
|
|
field: fmt.Sprintf("Attributes[%v]", idx), |
6895
|
|
|
reason: "embedded message failed validation", |
6896
|
|
|
cause: err, |
6897
|
|
|
} |
6898
|
|
|
} |
6899
|
|
|
} |
6900
|
|
|
|
6901
|
|
|
} |
6902
|
|
|
|
6903
|
|
|
// no validation rules for ContinuousToken |
6904
|
|
|
|
6905
|
|
|
if len(errors) > 0 { |
6906
|
|
|
return AttributeReadResponseMultiError(errors) |
6907
|
|
|
} |
6908
|
|
|
|
6909
|
|
|
return nil |
6910
|
|
|
} |
6911
|
|
|
|
6912
|
|
|
// AttributeReadResponseMultiError is an error wrapping multiple validation |
6913
|
|
|
// errors returned by AttributeReadResponse.ValidateAll() if the designated |
6914
|
|
|
// constraints aren't met. |
6915
|
|
|
type AttributeReadResponseMultiError []error |
6916
|
|
|
|
6917
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
6918
|
|
|
func (m AttributeReadResponseMultiError) Error() string { |
6919
|
|
|
var msgs []string |
6920
|
|
|
for _, err := range m { |
6921
|
|
|
msgs = append(msgs, err.Error()) |
6922
|
|
|
} |
6923
|
|
|
return strings.Join(msgs, "; ") |
6924
|
|
|
} |
6925
|
|
|
|
6926
|
|
|
// AllErrors returns a list of validation violation errors. |
6927
|
|
|
func (m AttributeReadResponseMultiError) AllErrors() []error { return m } |
6928
|
|
|
|
6929
|
|
|
// AttributeReadResponseValidationError is the validation error returned by |
6930
|
|
|
// AttributeReadResponse.Validate if the designated constraints aren't met. |
6931
|
|
|
type AttributeReadResponseValidationError struct { |
6932
|
|
|
field string |
6933
|
|
|
reason string |
6934
|
|
|
cause error |
6935
|
|
|
key bool |
6936
|
|
|
} |
6937
|
|
|
|
6938
|
|
|
// Field function returns field value. |
6939
|
|
|
func (e AttributeReadResponseValidationError) Field() string { return e.field } |
6940
|
|
|
|
6941
|
|
|
// Reason function returns reason value. |
6942
|
|
|
func (e AttributeReadResponseValidationError) Reason() string { return e.reason } |
6943
|
|
|
|
6944
|
|
|
// Cause function returns cause value. |
6945
|
|
|
func (e AttributeReadResponseValidationError) Cause() error { return e.cause } |
6946
|
|
|
|
6947
|
|
|
// Key function returns key value. |
6948
|
|
|
func (e AttributeReadResponseValidationError) Key() bool { return e.key } |
6949
|
|
|
|
6950
|
|
|
// ErrorName returns error name. |
6951
|
|
|
func (e AttributeReadResponseValidationError) ErrorName() string { |
6952
|
|
|
return "AttributeReadResponseValidationError" |
6953
|
|
|
} |
6954
|
|
|
|
6955
|
|
|
// Error satisfies the builtin error interface |
6956
|
|
|
func (e AttributeReadResponseValidationError) Error() string { |
6957
|
|
|
cause := "" |
6958
|
|
|
if e.cause != nil { |
6959
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
6960
|
|
|
} |
6961
|
|
|
|
6962
|
|
|
key := "" |
6963
|
|
|
if e.key { |
6964
|
|
|
key = "key for " |
6965
|
|
|
} |
6966
|
|
|
|
6967
|
|
|
return fmt.Sprintf( |
6968
|
|
|
"invalid %sAttributeReadResponse.%s: %s%s", |
6969
|
|
|
key, |
6970
|
|
|
e.field, |
6971
|
|
|
e.reason, |
6972
|
|
|
cause) |
6973
|
|
|
} |
6974
|
|
|
|
6975
|
|
|
var _ error = AttributeReadResponseValidationError{} |
6976
|
|
|
|
6977
|
|
|
var _ interface { |
6978
|
|
|
Field() string |
6979
|
|
|
Reason() string |
6980
|
|
|
Key() bool |
6981
|
|
|
Cause() error |
6982
|
|
|
ErrorName() string |
6983
|
|
|
} = AttributeReadResponseValidationError{} |
6984
|
|
|
|
6985
|
|
|
// Validate checks the field values on DataDeleteRequest with the rules defined |
6986
|
|
|
// in the proto definition for this message. If any rules are violated, the |
6987
|
|
|
// first error encountered is returned, or nil if there are no violations. |
6988
|
|
|
func (m *DataDeleteRequest) Validate() error { |
6989
|
|
|
return m.validate(false) |
6990
|
|
|
} |
6991
|
|
|
|
6992
|
|
|
// ValidateAll checks the field values on DataDeleteRequest with the rules |
6993
|
|
|
// defined in the proto definition for this message. If any rules are |
6994
|
|
|
// violated, the result is a list of violation errors wrapped in |
6995
|
|
|
// DataDeleteRequestMultiError, or nil if none found. |
6996
|
|
|
func (m *DataDeleteRequest) ValidateAll() error { |
6997
|
|
|
return m.validate(true) |
6998
|
|
|
} |
6999
|
|
|
|
7000
|
|
|
func (m *DataDeleteRequest) validate(all bool) error { |
7001
|
|
|
if m == nil { |
7002
|
|
|
return nil |
7003
|
|
|
} |
7004
|
|
|
|
7005
|
|
|
var errors []error |
7006
|
|
|
|
7007
|
|
|
if len(m.GetTenantId()) > 128 { |
7008
|
|
|
err := DataDeleteRequestValidationError{ |
7009
|
|
|
field: "TenantId", |
7010
|
|
|
reason: "value length must be at most 128 bytes", |
7011
|
|
|
} |
7012
|
|
|
if !all { |
7013
|
|
|
return err |
7014
|
|
|
} |
7015
|
|
|
errors = append(errors, err) |
7016
|
|
|
} |
7017
|
|
|
|
7018
|
|
|
if !_DataDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7019
|
|
|
err := DataDeleteRequestValidationError{ |
7020
|
|
|
field: "TenantId", |
7021
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7022
|
|
|
} |
7023
|
|
|
if !all { |
7024
|
|
|
return err |
7025
|
|
|
} |
7026
|
|
|
errors = append(errors, err) |
7027
|
|
|
} |
7028
|
|
|
|
7029
|
|
|
if m.GetTupleFilter() == nil { |
7030
|
|
|
err := DataDeleteRequestValidationError{ |
7031
|
|
|
field: "TupleFilter", |
7032
|
|
|
reason: "value is required", |
7033
|
|
|
} |
7034
|
|
|
if !all { |
7035
|
|
|
return err |
7036
|
|
|
} |
7037
|
|
|
errors = append(errors, err) |
7038
|
|
|
} |
7039
|
|
|
|
7040
|
|
|
if all { |
7041
|
|
|
switch v := interface{}(m.GetTupleFilter()).(type) { |
7042
|
|
|
case interface{ ValidateAll() error }: |
7043
|
|
|
if err := v.ValidateAll(); err != nil { |
7044
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7045
|
|
|
field: "TupleFilter", |
7046
|
|
|
reason: "embedded message failed validation", |
7047
|
|
|
cause: err, |
7048
|
|
|
}) |
7049
|
|
|
} |
7050
|
|
|
case interface{ Validate() error }: |
7051
|
|
|
if err := v.Validate(); err != nil { |
7052
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7053
|
|
|
field: "TupleFilter", |
7054
|
|
|
reason: "embedded message failed validation", |
7055
|
|
|
cause: err, |
7056
|
|
|
}) |
7057
|
|
|
} |
7058
|
|
|
} |
7059
|
|
|
} else if v, ok := interface{}(m.GetTupleFilter()).(interface{ Validate() error }); ok { |
7060
|
|
|
if err := v.Validate(); err != nil { |
7061
|
|
|
return DataDeleteRequestValidationError{ |
7062
|
|
|
field: "TupleFilter", |
7063
|
|
|
reason: "embedded message failed validation", |
7064
|
|
|
cause: err, |
7065
|
|
|
} |
7066
|
|
|
} |
7067
|
|
|
} |
7068
|
|
|
|
7069
|
|
|
if m.GetAttributeFilter() == nil { |
7070
|
|
|
err := DataDeleteRequestValidationError{ |
7071
|
|
|
field: "AttributeFilter", |
7072
|
|
|
reason: "value is required", |
7073
|
|
|
} |
7074
|
|
|
if !all { |
7075
|
|
|
return err |
7076
|
|
|
} |
7077
|
|
|
errors = append(errors, err) |
7078
|
|
|
} |
7079
|
|
|
|
7080
|
|
|
if all { |
7081
|
|
|
switch v := interface{}(m.GetAttributeFilter()).(type) { |
7082
|
|
|
case interface{ ValidateAll() error }: |
7083
|
|
|
if err := v.ValidateAll(); err != nil { |
7084
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7085
|
|
|
field: "AttributeFilter", |
7086
|
|
|
reason: "embedded message failed validation", |
7087
|
|
|
cause: err, |
7088
|
|
|
}) |
7089
|
|
|
} |
7090
|
|
|
case interface{ Validate() error }: |
7091
|
|
|
if err := v.Validate(); err != nil { |
7092
|
|
|
errors = append(errors, DataDeleteRequestValidationError{ |
7093
|
|
|
field: "AttributeFilter", |
7094
|
|
|
reason: "embedded message failed validation", |
7095
|
|
|
cause: err, |
7096
|
|
|
}) |
7097
|
|
|
} |
7098
|
|
|
} |
7099
|
|
|
} else if v, ok := interface{}(m.GetAttributeFilter()).(interface{ Validate() error }); ok { |
7100
|
|
|
if err := v.Validate(); err != nil { |
7101
|
|
|
return DataDeleteRequestValidationError{ |
7102
|
|
|
field: "AttributeFilter", |
7103
|
|
|
reason: "embedded message failed validation", |
7104
|
|
|
cause: err, |
7105
|
|
|
} |
7106
|
|
|
} |
7107
|
|
|
} |
7108
|
|
|
|
7109
|
|
|
if len(errors) > 0 { |
7110
|
|
|
return DataDeleteRequestMultiError(errors) |
7111
|
|
|
} |
7112
|
|
|
|
7113
|
|
|
return nil |
7114
|
|
|
} |
7115
|
|
|
|
7116
|
|
|
// DataDeleteRequestMultiError is an error wrapping multiple validation errors |
7117
|
|
|
// returned by DataDeleteRequest.ValidateAll() if the designated constraints |
7118
|
|
|
// aren't met. |
7119
|
|
|
type DataDeleteRequestMultiError []error |
7120
|
|
|
|
7121
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7122
|
|
|
func (m DataDeleteRequestMultiError) Error() string { |
7123
|
|
|
var msgs []string |
7124
|
|
|
for _, err := range m { |
7125
|
|
|
msgs = append(msgs, err.Error()) |
7126
|
|
|
} |
7127
|
|
|
return strings.Join(msgs, "; ") |
7128
|
|
|
} |
7129
|
|
|
|
7130
|
|
|
// AllErrors returns a list of validation violation errors. |
7131
|
|
|
func (m DataDeleteRequestMultiError) AllErrors() []error { return m } |
7132
|
|
|
|
7133
|
|
|
// DataDeleteRequestValidationError is the validation error returned by |
7134
|
|
|
// DataDeleteRequest.Validate if the designated constraints aren't met. |
7135
|
|
|
type DataDeleteRequestValidationError struct { |
7136
|
|
|
field string |
7137
|
|
|
reason string |
7138
|
|
|
cause error |
7139
|
|
|
key bool |
7140
|
|
|
} |
7141
|
|
|
|
7142
|
|
|
// Field function returns field value. |
7143
|
|
|
func (e DataDeleteRequestValidationError) Field() string { return e.field } |
7144
|
|
|
|
7145
|
|
|
// Reason function returns reason value. |
7146
|
|
|
func (e DataDeleteRequestValidationError) Reason() string { return e.reason } |
7147
|
|
|
|
7148
|
|
|
// Cause function returns cause value. |
7149
|
|
|
func (e DataDeleteRequestValidationError) Cause() error { return e.cause } |
7150
|
|
|
|
7151
|
|
|
// Key function returns key value. |
7152
|
|
|
func (e DataDeleteRequestValidationError) Key() bool { return e.key } |
7153
|
|
|
|
7154
|
|
|
// ErrorName returns error name. |
7155
|
|
|
func (e DataDeleteRequestValidationError) ErrorName() string { |
7156
|
|
|
return "DataDeleteRequestValidationError" |
7157
|
|
|
} |
7158
|
|
|
|
7159
|
|
|
// Error satisfies the builtin error interface |
7160
|
|
|
func (e DataDeleteRequestValidationError) Error() string { |
7161
|
|
|
cause := "" |
7162
|
|
|
if e.cause != nil { |
7163
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7164
|
|
|
} |
7165
|
|
|
|
7166
|
|
|
key := "" |
7167
|
|
|
if e.key { |
7168
|
|
|
key = "key for " |
7169
|
|
|
} |
7170
|
|
|
|
7171
|
|
|
return fmt.Sprintf( |
7172
|
|
|
"invalid %sDataDeleteRequest.%s: %s%s", |
7173
|
|
|
key, |
7174
|
|
|
e.field, |
7175
|
|
|
e.reason, |
7176
|
|
|
cause) |
7177
|
|
|
} |
7178
|
|
|
|
7179
|
|
|
var _ error = DataDeleteRequestValidationError{} |
7180
|
|
|
|
7181
|
|
|
var _ interface { |
7182
|
|
|
Field() string |
7183
|
|
|
Reason() string |
7184
|
|
|
Key() bool |
7185
|
|
|
Cause() error |
7186
|
|
|
ErrorName() string |
7187
|
|
|
} = DataDeleteRequestValidationError{} |
7188
|
|
|
|
7189
|
|
|
var _DataDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7190
|
|
|
|
7191
|
|
|
// Validate checks the field values on DataDeleteResponse with the rules |
7192
|
|
|
// defined in the proto definition for this message. If any rules are |
7193
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7194
|
|
|
func (m *DataDeleteResponse) Validate() error { |
7195
|
|
|
return m.validate(false) |
7196
|
|
|
} |
7197
|
|
|
|
7198
|
|
|
// ValidateAll checks the field values on DataDeleteResponse with the rules |
7199
|
|
|
// defined in the proto definition for this message. If any rules are |
7200
|
|
|
// violated, the result is a list of violation errors wrapped in |
7201
|
|
|
// DataDeleteResponseMultiError, or nil if none found. |
7202
|
|
|
func (m *DataDeleteResponse) ValidateAll() error { |
7203
|
|
|
return m.validate(true) |
7204
|
|
|
} |
7205
|
|
|
|
7206
|
|
|
func (m *DataDeleteResponse) validate(all bool) error { |
7207
|
|
|
if m == nil { |
7208
|
|
|
return nil |
7209
|
|
|
} |
7210
|
|
|
|
7211
|
|
|
var errors []error |
7212
|
|
|
|
7213
|
|
|
// no validation rules for SnapToken |
7214
|
|
|
|
7215
|
|
|
if len(errors) > 0 { |
7216
|
|
|
return DataDeleteResponseMultiError(errors) |
7217
|
|
|
} |
7218
|
|
|
|
7219
|
|
|
return nil |
7220
|
|
|
} |
7221
|
|
|
|
7222
|
|
|
// DataDeleteResponseMultiError is an error wrapping multiple validation errors |
7223
|
|
|
// returned by DataDeleteResponse.ValidateAll() if the designated constraints |
7224
|
|
|
// aren't met. |
7225
|
|
|
type DataDeleteResponseMultiError []error |
7226
|
|
|
|
7227
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7228
|
|
|
func (m DataDeleteResponseMultiError) Error() string { |
7229
|
|
|
var msgs []string |
7230
|
|
|
for _, err := range m { |
7231
|
|
|
msgs = append(msgs, err.Error()) |
7232
|
|
|
} |
7233
|
|
|
return strings.Join(msgs, "; ") |
7234
|
|
|
} |
7235
|
|
|
|
7236
|
|
|
// AllErrors returns a list of validation violation errors. |
7237
|
|
|
func (m DataDeleteResponseMultiError) AllErrors() []error { return m } |
7238
|
|
|
|
7239
|
|
|
// DataDeleteResponseValidationError is the validation error returned by |
7240
|
|
|
// DataDeleteResponse.Validate if the designated constraints aren't met. |
7241
|
|
|
type DataDeleteResponseValidationError struct { |
7242
|
|
|
field string |
7243
|
|
|
reason string |
7244
|
|
|
cause error |
7245
|
|
|
key bool |
7246
|
|
|
} |
7247
|
|
|
|
7248
|
|
|
// Field function returns field value. |
7249
|
|
|
func (e DataDeleteResponseValidationError) Field() string { return e.field } |
7250
|
|
|
|
7251
|
|
|
// Reason function returns reason value. |
7252
|
|
|
func (e DataDeleteResponseValidationError) Reason() string { return e.reason } |
7253
|
|
|
|
7254
|
|
|
// Cause function returns cause value. |
7255
|
|
|
func (e DataDeleteResponseValidationError) Cause() error { return e.cause } |
7256
|
|
|
|
7257
|
|
|
// Key function returns key value. |
7258
|
|
|
func (e DataDeleteResponseValidationError) Key() bool { return e.key } |
7259
|
|
|
|
7260
|
|
|
// ErrorName returns error name. |
7261
|
|
|
func (e DataDeleteResponseValidationError) ErrorName() string { |
7262
|
|
|
return "DataDeleteResponseValidationError" |
7263
|
|
|
} |
7264
|
|
|
|
7265
|
|
|
// Error satisfies the builtin error interface |
7266
|
|
|
func (e DataDeleteResponseValidationError) Error() string { |
7267
|
|
|
cause := "" |
7268
|
|
|
if e.cause != nil { |
7269
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7270
|
|
|
} |
7271
|
|
|
|
7272
|
|
|
key := "" |
7273
|
|
|
if e.key { |
7274
|
|
|
key = "key for " |
7275
|
|
|
} |
7276
|
|
|
|
7277
|
|
|
return fmt.Sprintf( |
7278
|
|
|
"invalid %sDataDeleteResponse.%s: %s%s", |
7279
|
|
|
key, |
7280
|
|
|
e.field, |
7281
|
|
|
e.reason, |
7282
|
|
|
cause) |
7283
|
|
|
} |
7284
|
|
|
|
7285
|
|
|
var _ error = DataDeleteResponseValidationError{} |
7286
|
|
|
|
7287
|
|
|
var _ interface { |
7288
|
|
|
Field() string |
7289
|
|
|
Reason() string |
7290
|
|
|
Key() bool |
7291
|
|
|
Cause() error |
7292
|
|
|
ErrorName() string |
7293
|
|
|
} = DataDeleteResponseValidationError{} |
7294
|
|
|
|
7295
|
|
|
// Validate checks the field values on RelationshipDeleteRequest with the rules |
7296
|
|
|
// defined in the proto definition for this message. If any rules are |
7297
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7298
|
|
|
func (m *RelationshipDeleteRequest) Validate() error { |
7299
|
|
|
return m.validate(false) |
7300
|
|
|
} |
7301
|
|
|
|
7302
|
|
|
// ValidateAll checks the field values on RelationshipDeleteRequest with the |
7303
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7304
|
|
|
// violated, the result is a list of violation errors wrapped in |
7305
|
|
|
// RelationshipDeleteRequestMultiError, or nil if none found. |
7306
|
|
|
func (m *RelationshipDeleteRequest) ValidateAll() error { |
7307
|
|
|
return m.validate(true) |
7308
|
|
|
} |
7309
|
|
|
|
7310
|
|
|
func (m *RelationshipDeleteRequest) validate(all bool) error { |
7311
|
|
|
if m == nil { |
7312
|
|
|
return nil |
7313
|
|
|
} |
7314
|
|
|
|
7315
|
|
|
var errors []error |
7316
|
|
|
|
7317
|
|
|
if len(m.GetTenantId()) > 128 { |
7318
|
|
|
err := RelationshipDeleteRequestValidationError{ |
7319
|
|
|
field: "TenantId", |
7320
|
|
|
reason: "value length must be at most 128 bytes", |
7321
|
|
|
} |
7322
|
|
|
if !all { |
7323
|
|
|
return err |
7324
|
|
|
} |
7325
|
|
|
errors = append(errors, err) |
7326
|
|
|
} |
7327
|
|
|
|
7328
|
|
|
if !_RelationshipDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7329
|
|
|
err := RelationshipDeleteRequestValidationError{ |
7330
|
|
|
field: "TenantId", |
7331
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7332
|
|
|
} |
7333
|
|
|
if !all { |
7334
|
|
|
return err |
7335
|
|
|
} |
7336
|
|
|
errors = append(errors, err) |
7337
|
|
|
} |
7338
|
|
|
|
7339
|
|
|
if all { |
7340
|
|
|
switch v := interface{}(m.GetFilter()).(type) { |
7341
|
|
|
case interface{ ValidateAll() error }: |
7342
|
|
|
if err := v.ValidateAll(); err != nil { |
7343
|
|
|
errors = append(errors, RelationshipDeleteRequestValidationError{ |
7344
|
|
|
field: "Filter", |
7345
|
|
|
reason: "embedded message failed validation", |
7346
|
|
|
cause: err, |
7347
|
|
|
}) |
7348
|
|
|
} |
7349
|
|
|
case interface{ Validate() error }: |
7350
|
|
|
if err := v.Validate(); err != nil { |
7351
|
|
|
errors = append(errors, RelationshipDeleteRequestValidationError{ |
7352
|
|
|
field: "Filter", |
7353
|
|
|
reason: "embedded message failed validation", |
7354
|
|
|
cause: err, |
7355
|
|
|
}) |
7356
|
|
|
} |
7357
|
|
|
} |
7358
|
|
|
} else if v, ok := interface{}(m.GetFilter()).(interface{ Validate() error }); ok { |
7359
|
|
|
if err := v.Validate(); err != nil { |
7360
|
|
|
return RelationshipDeleteRequestValidationError{ |
7361
|
|
|
field: "Filter", |
7362
|
|
|
reason: "embedded message failed validation", |
7363
|
|
|
cause: err, |
7364
|
|
|
} |
7365
|
|
|
} |
7366
|
|
|
} |
7367
|
|
|
|
7368
|
|
|
if len(errors) > 0 { |
7369
|
|
|
return RelationshipDeleteRequestMultiError(errors) |
7370
|
|
|
} |
7371
|
|
|
|
7372
|
|
|
return nil |
7373
|
|
|
} |
7374
|
|
|
|
7375
|
|
|
// RelationshipDeleteRequestMultiError is an error wrapping multiple validation |
7376
|
|
|
// errors returned by RelationshipDeleteRequest.ValidateAll() if the |
7377
|
|
|
// designated constraints aren't met. |
7378
|
|
|
type RelationshipDeleteRequestMultiError []error |
7379
|
|
|
|
7380
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7381
|
|
|
func (m RelationshipDeleteRequestMultiError) Error() string { |
7382
|
|
|
var msgs []string |
7383
|
|
|
for _, err := range m { |
7384
|
|
|
msgs = append(msgs, err.Error()) |
7385
|
|
|
} |
7386
|
|
|
return strings.Join(msgs, "; ") |
7387
|
|
|
} |
7388
|
|
|
|
7389
|
|
|
// AllErrors returns a list of validation violation errors. |
7390
|
|
|
func (m RelationshipDeleteRequestMultiError) AllErrors() []error { return m } |
7391
|
|
|
|
7392
|
|
|
// RelationshipDeleteRequestValidationError is the validation error returned by |
7393
|
|
|
// RelationshipDeleteRequest.Validate if the designated constraints aren't met. |
7394
|
|
|
type RelationshipDeleteRequestValidationError struct { |
7395
|
|
|
field string |
7396
|
|
|
reason string |
7397
|
|
|
cause error |
7398
|
|
|
key bool |
7399
|
|
|
} |
7400
|
|
|
|
7401
|
|
|
// Field function returns field value. |
7402
|
|
|
func (e RelationshipDeleteRequestValidationError) Field() string { return e.field } |
7403
|
|
|
|
7404
|
|
|
// Reason function returns reason value. |
7405
|
|
|
func (e RelationshipDeleteRequestValidationError) Reason() string { return e.reason } |
7406
|
|
|
|
7407
|
|
|
// Cause function returns cause value. |
7408
|
|
|
func (e RelationshipDeleteRequestValidationError) Cause() error { return e.cause } |
7409
|
|
|
|
7410
|
|
|
// Key function returns key value. |
7411
|
|
|
func (e RelationshipDeleteRequestValidationError) Key() bool { return e.key } |
7412
|
|
|
|
7413
|
|
|
// ErrorName returns error name. |
7414
|
|
|
func (e RelationshipDeleteRequestValidationError) ErrorName() string { |
7415
|
|
|
return "RelationshipDeleteRequestValidationError" |
7416
|
|
|
} |
7417
|
|
|
|
7418
|
|
|
// Error satisfies the builtin error interface |
7419
|
|
|
func (e RelationshipDeleteRequestValidationError) Error() string { |
7420
|
|
|
cause := "" |
7421
|
|
|
if e.cause != nil { |
7422
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7423
|
|
|
} |
7424
|
|
|
|
7425
|
|
|
key := "" |
7426
|
|
|
if e.key { |
7427
|
|
|
key = "key for " |
7428
|
|
|
} |
7429
|
|
|
|
7430
|
|
|
return fmt.Sprintf( |
7431
|
|
|
"invalid %sRelationshipDeleteRequest.%s: %s%s", |
7432
|
|
|
key, |
7433
|
|
|
e.field, |
7434
|
|
|
e.reason, |
7435
|
|
|
cause) |
7436
|
|
|
} |
7437
|
|
|
|
7438
|
|
|
var _ error = RelationshipDeleteRequestValidationError{} |
7439
|
|
|
|
7440
|
|
|
var _ interface { |
7441
|
|
|
Field() string |
7442
|
|
|
Reason() string |
7443
|
|
|
Key() bool |
7444
|
|
|
Cause() error |
7445
|
|
|
ErrorName() string |
7446
|
|
|
} = RelationshipDeleteRequestValidationError{} |
7447
|
|
|
|
7448
|
|
|
var _RelationshipDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7449
|
|
|
|
7450
|
|
|
// Validate checks the field values on RelationshipDeleteResponse with the |
7451
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7452
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7453
|
|
|
func (m *RelationshipDeleteResponse) Validate() error { |
7454
|
|
|
return m.validate(false) |
7455
|
|
|
} |
7456
|
|
|
|
7457
|
|
|
// ValidateAll checks the field values on RelationshipDeleteResponse with the |
7458
|
|
|
// rules defined in the proto definition for this message. If any rules are |
7459
|
|
|
// violated, the result is a list of violation errors wrapped in |
7460
|
|
|
// RelationshipDeleteResponseMultiError, or nil if none found. |
7461
|
|
|
func (m *RelationshipDeleteResponse) ValidateAll() error { |
7462
|
|
|
return m.validate(true) |
7463
|
|
|
} |
7464
|
|
|
|
7465
|
|
|
func (m *RelationshipDeleteResponse) validate(all bool) error { |
7466
|
|
|
if m == nil { |
7467
|
|
|
return nil |
7468
|
|
|
} |
7469
|
|
|
|
7470
|
|
|
var errors []error |
7471
|
|
|
|
7472
|
|
|
// no validation rules for SnapToken |
7473
|
|
|
|
7474
|
|
|
if len(errors) > 0 { |
7475
|
|
|
return RelationshipDeleteResponseMultiError(errors) |
7476
|
|
|
} |
7477
|
|
|
|
7478
|
|
|
return nil |
7479
|
|
|
} |
7480
|
|
|
|
7481
|
|
|
// RelationshipDeleteResponseMultiError is an error wrapping multiple |
7482
|
|
|
// validation errors returned by RelationshipDeleteResponse.ValidateAll() if |
7483
|
|
|
// the designated constraints aren't met. |
7484
|
|
|
type RelationshipDeleteResponseMultiError []error |
7485
|
|
|
|
7486
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7487
|
|
|
func (m RelationshipDeleteResponseMultiError) Error() string { |
7488
|
|
|
var msgs []string |
7489
|
|
|
for _, err := range m { |
7490
|
|
|
msgs = append(msgs, err.Error()) |
7491
|
|
|
} |
7492
|
|
|
return strings.Join(msgs, "; ") |
7493
|
|
|
} |
7494
|
|
|
|
7495
|
|
|
// AllErrors returns a list of validation violation errors. |
7496
|
|
|
func (m RelationshipDeleteResponseMultiError) AllErrors() []error { return m } |
7497
|
|
|
|
7498
|
|
|
// RelationshipDeleteResponseValidationError is the validation error returned |
7499
|
|
|
// by RelationshipDeleteResponse.Validate if the designated constraints aren't met. |
7500
|
|
|
type RelationshipDeleteResponseValidationError struct { |
7501
|
|
|
field string |
7502
|
|
|
reason string |
7503
|
|
|
cause error |
7504
|
|
|
key bool |
7505
|
|
|
} |
7506
|
|
|
|
7507
|
|
|
// Field function returns field value. |
7508
|
|
|
func (e RelationshipDeleteResponseValidationError) Field() string { return e.field } |
7509
|
|
|
|
7510
|
|
|
// Reason function returns reason value. |
7511
|
|
|
func (e RelationshipDeleteResponseValidationError) Reason() string { return e.reason } |
7512
|
|
|
|
7513
|
|
|
// Cause function returns cause value. |
7514
|
|
|
func (e RelationshipDeleteResponseValidationError) Cause() error { return e.cause } |
7515
|
|
|
|
7516
|
|
|
// Key function returns key value. |
7517
|
|
|
func (e RelationshipDeleteResponseValidationError) Key() bool { return e.key } |
7518
|
|
|
|
7519
|
|
|
// ErrorName returns error name. |
7520
|
|
|
func (e RelationshipDeleteResponseValidationError) ErrorName() string { |
7521
|
|
|
return "RelationshipDeleteResponseValidationError" |
7522
|
|
|
} |
7523
|
|
|
|
7524
|
|
|
// Error satisfies the builtin error interface |
7525
|
|
|
func (e RelationshipDeleteResponseValidationError) Error() string { |
7526
|
|
|
cause := "" |
7527
|
|
|
if e.cause != nil { |
7528
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7529
|
|
|
} |
7530
|
|
|
|
7531
|
|
|
key := "" |
7532
|
|
|
if e.key { |
7533
|
|
|
key = "key for " |
7534
|
|
|
} |
7535
|
|
|
|
7536
|
|
|
return fmt.Sprintf( |
7537
|
|
|
"invalid %sRelationshipDeleteResponse.%s: %s%s", |
7538
|
|
|
key, |
7539
|
|
|
e.field, |
7540
|
|
|
e.reason, |
7541
|
|
|
cause) |
7542
|
|
|
} |
7543
|
|
|
|
7544
|
|
|
var _ error = RelationshipDeleteResponseValidationError{} |
7545
|
|
|
|
7546
|
|
|
var _ interface { |
7547
|
|
|
Field() string |
7548
|
|
|
Reason() string |
7549
|
|
|
Key() bool |
7550
|
|
|
Cause() error |
7551
|
|
|
ErrorName() string |
7552
|
|
|
} = RelationshipDeleteResponseValidationError{} |
7553
|
|
|
|
7554
|
|
|
// Validate checks the field values on BundleRunRequest with the rules defined |
7555
|
|
|
// in the proto definition for this message. If any rules are violated, the |
7556
|
|
|
// first error encountered is returned, or nil if there are no violations. |
7557
|
|
|
func (m *BundleRunRequest) Validate() error { |
7558
|
|
|
return m.validate(false) |
7559
|
|
|
} |
7560
|
|
|
|
7561
|
|
|
// ValidateAll checks the field values on BundleRunRequest with the rules |
7562
|
|
|
// defined in the proto definition for this message. If any rules are |
7563
|
|
|
// violated, the result is a list of violation errors wrapped in |
7564
|
|
|
// BundleRunRequestMultiError, or nil if none found. |
7565
|
|
|
func (m *BundleRunRequest) ValidateAll() error { |
7566
|
|
|
return m.validate(true) |
7567
|
|
|
} |
7568
|
|
|
|
7569
|
|
|
func (m *BundleRunRequest) validate(all bool) error { |
7570
|
|
|
if m == nil { |
7571
|
|
|
return nil |
7572
|
|
|
} |
7573
|
|
|
|
7574
|
|
|
var errors []error |
7575
|
|
|
|
7576
|
|
|
if len(m.GetTenantId()) > 128 { |
7577
|
|
|
err := BundleRunRequestValidationError{ |
7578
|
|
|
field: "TenantId", |
7579
|
|
|
reason: "value length must be at most 128 bytes", |
7580
|
|
|
} |
7581
|
|
|
if !all { |
7582
|
|
|
return err |
7583
|
|
|
} |
7584
|
|
|
errors = append(errors, err) |
7585
|
|
|
} |
7586
|
|
|
|
7587
|
|
|
if !_BundleRunRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7588
|
|
|
err := BundleRunRequestValidationError{ |
7589
|
|
|
field: "TenantId", |
7590
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7591
|
|
|
} |
7592
|
|
|
if !all { |
7593
|
|
|
return err |
7594
|
|
|
} |
7595
|
|
|
errors = append(errors, err) |
7596
|
|
|
} |
7597
|
|
|
|
7598
|
|
|
// no validation rules for Name |
7599
|
|
|
|
7600
|
|
|
// no validation rules for Arguments |
7601
|
|
|
|
7602
|
|
|
if len(errors) > 0 { |
7603
|
|
|
return BundleRunRequestMultiError(errors) |
7604
|
|
|
} |
7605
|
|
|
|
7606
|
|
|
return nil |
7607
|
|
|
} |
7608
|
|
|
|
7609
|
|
|
// BundleRunRequestMultiError is an error wrapping multiple validation errors |
7610
|
|
|
// returned by BundleRunRequest.ValidateAll() if the designated constraints |
7611
|
|
|
// aren't met. |
7612
|
|
|
type BundleRunRequestMultiError []error |
7613
|
|
|
|
7614
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7615
|
|
|
func (m BundleRunRequestMultiError) Error() string { |
7616
|
|
|
var msgs []string |
7617
|
|
|
for _, err := range m { |
7618
|
|
|
msgs = append(msgs, err.Error()) |
7619
|
|
|
} |
7620
|
|
|
return strings.Join(msgs, "; ") |
7621
|
|
|
} |
7622
|
|
|
|
7623
|
|
|
// AllErrors returns a list of validation violation errors. |
7624
|
|
|
func (m BundleRunRequestMultiError) AllErrors() []error { return m } |
7625
|
|
|
|
7626
|
|
|
// BundleRunRequestValidationError is the validation error returned by |
7627
|
|
|
// BundleRunRequest.Validate if the designated constraints aren't met. |
7628
|
|
|
type BundleRunRequestValidationError struct { |
7629
|
|
|
field string |
7630
|
|
|
reason string |
7631
|
|
|
cause error |
7632
|
|
|
key bool |
7633
|
|
|
} |
7634
|
|
|
|
7635
|
|
|
// Field function returns field value. |
7636
|
|
|
func (e BundleRunRequestValidationError) Field() string { return e.field } |
7637
|
|
|
|
7638
|
|
|
// Reason function returns reason value. |
7639
|
|
|
func (e BundleRunRequestValidationError) Reason() string { return e.reason } |
7640
|
|
|
|
7641
|
|
|
// Cause function returns cause value. |
7642
|
|
|
func (e BundleRunRequestValidationError) Cause() error { return e.cause } |
7643
|
|
|
|
7644
|
|
|
// Key function returns key value. |
7645
|
|
|
func (e BundleRunRequestValidationError) Key() bool { return e.key } |
7646
|
|
|
|
7647
|
|
|
// ErrorName returns error name. |
7648
|
|
|
func (e BundleRunRequestValidationError) ErrorName() string { return "BundleRunRequestValidationError" } |
7649
|
|
|
|
7650
|
|
|
// Error satisfies the builtin error interface |
7651
|
|
|
func (e BundleRunRequestValidationError) Error() string { |
7652
|
|
|
cause := "" |
7653
|
|
|
if e.cause != nil { |
7654
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7655
|
|
|
} |
7656
|
|
|
|
7657
|
|
|
key := "" |
7658
|
|
|
if e.key { |
7659
|
|
|
key = "key for " |
7660
|
|
|
} |
7661
|
|
|
|
7662
|
|
|
return fmt.Sprintf( |
7663
|
|
|
"invalid %sBundleRunRequest.%s: %s%s", |
7664
|
|
|
key, |
7665
|
|
|
e.field, |
7666
|
|
|
e.reason, |
7667
|
|
|
cause) |
7668
|
|
|
} |
7669
|
|
|
|
7670
|
|
|
var _ error = BundleRunRequestValidationError{} |
7671
|
|
|
|
7672
|
|
|
var _ interface { |
7673
|
|
|
Field() string |
7674
|
|
|
Reason() string |
7675
|
|
|
Key() bool |
7676
|
|
|
Cause() error |
7677
|
|
|
ErrorName() string |
7678
|
|
|
} = BundleRunRequestValidationError{} |
7679
|
|
|
|
7680
|
|
|
var _BundleRunRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7681
|
|
|
|
7682
|
|
|
// Validate checks the field values on BundleRunResponse with the rules defined |
7683
|
|
|
// in the proto definition for this message. If any rules are violated, the |
7684
|
|
|
// first error encountered is returned, or nil if there are no violations. |
7685
|
|
|
func (m *BundleRunResponse) Validate() error { |
7686
|
|
|
return m.validate(false) |
7687
|
|
|
} |
7688
|
|
|
|
7689
|
|
|
// ValidateAll checks the field values on BundleRunResponse with the rules |
7690
|
|
|
// defined in the proto definition for this message. If any rules are |
7691
|
|
|
// violated, the result is a list of violation errors wrapped in |
7692
|
|
|
// BundleRunResponseMultiError, or nil if none found. |
7693
|
|
|
func (m *BundleRunResponse) ValidateAll() error { |
7694
|
|
|
return m.validate(true) |
7695
|
|
|
} |
7696
|
|
|
|
7697
|
|
|
func (m *BundleRunResponse) validate(all bool) error { |
7698
|
|
|
if m == nil { |
7699
|
|
|
return nil |
7700
|
|
|
} |
7701
|
|
|
|
7702
|
|
|
var errors []error |
7703
|
|
|
|
7704
|
|
|
// no validation rules for SnapToken |
7705
|
|
|
|
7706
|
|
|
if len(errors) > 0 { |
7707
|
|
|
return BundleRunResponseMultiError(errors) |
7708
|
|
|
} |
7709
|
|
|
|
7710
|
|
|
return nil |
7711
|
|
|
} |
7712
|
|
|
|
7713
|
|
|
// BundleRunResponseMultiError is an error wrapping multiple validation errors |
7714
|
|
|
// returned by BundleRunResponse.ValidateAll() if the designated constraints |
7715
|
|
|
// aren't met. |
7716
|
|
|
type BundleRunResponseMultiError []error |
7717
|
|
|
|
7718
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7719
|
|
|
func (m BundleRunResponseMultiError) Error() string { |
7720
|
|
|
var msgs []string |
7721
|
|
|
for _, err := range m { |
7722
|
|
|
msgs = append(msgs, err.Error()) |
7723
|
|
|
} |
7724
|
|
|
return strings.Join(msgs, "; ") |
7725
|
|
|
} |
7726
|
|
|
|
7727
|
|
|
// AllErrors returns a list of validation violation errors. |
7728
|
|
|
func (m BundleRunResponseMultiError) AllErrors() []error { return m } |
7729
|
|
|
|
7730
|
|
|
// BundleRunResponseValidationError is the validation error returned by |
7731
|
|
|
// BundleRunResponse.Validate if the designated constraints aren't met. |
7732
|
|
|
type BundleRunResponseValidationError struct { |
7733
|
|
|
field string |
7734
|
|
|
reason string |
7735
|
|
|
cause error |
7736
|
|
|
key bool |
7737
|
|
|
} |
7738
|
|
|
|
7739
|
|
|
// Field function returns field value. |
7740
|
|
|
func (e BundleRunResponseValidationError) Field() string { return e.field } |
7741
|
|
|
|
7742
|
|
|
// Reason function returns reason value. |
7743
|
|
|
func (e BundleRunResponseValidationError) Reason() string { return e.reason } |
7744
|
|
|
|
7745
|
|
|
// Cause function returns cause value. |
7746
|
|
|
func (e BundleRunResponseValidationError) Cause() error { return e.cause } |
7747
|
|
|
|
7748
|
|
|
// Key function returns key value. |
7749
|
|
|
func (e BundleRunResponseValidationError) Key() bool { return e.key } |
7750
|
|
|
|
7751
|
|
|
// ErrorName returns error name. |
7752
|
|
|
func (e BundleRunResponseValidationError) ErrorName() string { |
7753
|
|
|
return "BundleRunResponseValidationError" |
7754
|
|
|
} |
7755
|
|
|
|
7756
|
|
|
// Error satisfies the builtin error interface |
7757
|
|
|
func (e BundleRunResponseValidationError) Error() string { |
7758
|
|
|
cause := "" |
7759
|
|
|
if e.cause != nil { |
7760
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7761
|
|
|
} |
7762
|
|
|
|
7763
|
|
|
key := "" |
7764
|
|
|
if e.key { |
7765
|
|
|
key = "key for " |
7766
|
|
|
} |
7767
|
|
|
|
7768
|
|
|
return fmt.Sprintf( |
7769
|
|
|
"invalid %sBundleRunResponse.%s: %s%s", |
7770
|
|
|
key, |
7771
|
|
|
e.field, |
7772
|
|
|
e.reason, |
7773
|
|
|
cause) |
7774
|
|
|
} |
7775
|
|
|
|
7776
|
|
|
var _ error = BundleRunResponseValidationError{} |
7777
|
|
|
|
7778
|
|
|
var _ interface { |
7779
|
|
|
Field() string |
7780
|
|
|
Reason() string |
7781
|
|
|
Key() bool |
7782
|
|
|
Cause() error |
7783
|
|
|
ErrorName() string |
7784
|
|
|
} = BundleRunResponseValidationError{} |
7785
|
|
|
|
7786
|
|
|
// Validate checks the field values on BundleWriteRequest with the rules |
7787
|
|
|
// defined in the proto definition for this message. If any rules are |
7788
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7789
|
|
|
func (m *BundleWriteRequest) Validate() error { |
7790
|
|
|
return m.validate(false) |
7791
|
|
|
} |
7792
|
|
|
|
7793
|
|
|
// ValidateAll checks the field values on BundleWriteRequest with the rules |
7794
|
|
|
// defined in the proto definition for this message. If any rules are |
7795
|
|
|
// violated, the result is a list of violation errors wrapped in |
7796
|
|
|
// BundleWriteRequestMultiError, or nil if none found. |
7797
|
|
|
func (m *BundleWriteRequest) ValidateAll() error { |
7798
|
|
|
return m.validate(true) |
7799
|
|
|
} |
7800
|
|
|
|
7801
|
|
|
func (m *BundleWriteRequest) validate(all bool) error { |
7802
|
|
|
if m == nil { |
7803
|
|
|
return nil |
7804
|
|
|
} |
7805
|
|
|
|
7806
|
|
|
var errors []error |
7807
|
|
|
|
7808
|
|
|
if len(m.GetTenantId()) > 128 { |
7809
|
|
|
err := BundleWriteRequestValidationError{ |
7810
|
|
|
field: "TenantId", |
7811
|
|
|
reason: "value length must be at most 128 bytes", |
7812
|
|
|
} |
7813
|
|
|
if !all { |
7814
|
|
|
return err |
7815
|
|
|
} |
7816
|
|
|
errors = append(errors, err) |
7817
|
|
|
} |
7818
|
|
|
|
7819
|
|
|
if !_BundleWriteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
7820
|
|
|
err := BundleWriteRequestValidationError{ |
7821
|
|
|
field: "TenantId", |
7822
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
7823
|
|
|
} |
7824
|
|
|
if !all { |
7825
|
|
|
return err |
7826
|
|
|
} |
7827
|
|
|
errors = append(errors, err) |
7828
|
|
|
} |
7829
|
|
|
|
7830
|
|
|
for idx, item := range m.GetBundles() { |
7831
|
|
|
_, _ = idx, item |
7832
|
|
|
|
7833
|
|
|
if all { |
7834
|
|
|
switch v := interface{}(item).(type) { |
7835
|
|
|
case interface{ ValidateAll() error }: |
7836
|
|
|
if err := v.ValidateAll(); err != nil { |
7837
|
|
|
errors = append(errors, BundleWriteRequestValidationError{ |
7838
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
7839
|
|
|
reason: "embedded message failed validation", |
7840
|
|
|
cause: err, |
7841
|
|
|
}) |
7842
|
|
|
} |
7843
|
|
|
case interface{ Validate() error }: |
7844
|
|
|
if err := v.Validate(); err != nil { |
7845
|
|
|
errors = append(errors, BundleWriteRequestValidationError{ |
7846
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
7847
|
|
|
reason: "embedded message failed validation", |
7848
|
|
|
cause: err, |
7849
|
|
|
}) |
7850
|
|
|
} |
7851
|
|
|
} |
7852
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
7853
|
|
|
if err := v.Validate(); err != nil { |
7854
|
|
|
return BundleWriteRequestValidationError{ |
7855
|
|
|
field: fmt.Sprintf("Bundles[%v]", idx), |
7856
|
|
|
reason: "embedded message failed validation", |
7857
|
|
|
cause: err, |
7858
|
|
|
} |
7859
|
|
|
} |
7860
|
|
|
} |
7861
|
|
|
|
7862
|
|
|
} |
7863
|
|
|
|
7864
|
|
|
if len(errors) > 0 { |
7865
|
|
|
return BundleWriteRequestMultiError(errors) |
7866
|
|
|
} |
7867
|
|
|
|
7868
|
|
|
return nil |
7869
|
|
|
} |
7870
|
|
|
|
7871
|
|
|
// BundleWriteRequestMultiError is an error wrapping multiple validation errors |
7872
|
|
|
// returned by BundleWriteRequest.ValidateAll() if the designated constraints |
7873
|
|
|
// aren't met. |
7874
|
|
|
type BundleWriteRequestMultiError []error |
7875
|
|
|
|
7876
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7877
|
|
|
func (m BundleWriteRequestMultiError) Error() string { |
7878
|
|
|
var msgs []string |
7879
|
|
|
for _, err := range m { |
7880
|
|
|
msgs = append(msgs, err.Error()) |
7881
|
|
|
} |
7882
|
|
|
return strings.Join(msgs, "; ") |
7883
|
|
|
} |
7884
|
|
|
|
7885
|
|
|
// AllErrors returns a list of validation violation errors. |
7886
|
|
|
func (m BundleWriteRequestMultiError) AllErrors() []error { return m } |
7887
|
|
|
|
7888
|
|
|
// BundleWriteRequestValidationError is the validation error returned by |
7889
|
|
|
// BundleWriteRequest.Validate if the designated constraints aren't met. |
7890
|
|
|
type BundleWriteRequestValidationError struct { |
7891
|
|
|
field string |
7892
|
|
|
reason string |
7893
|
|
|
cause error |
7894
|
|
|
key bool |
7895
|
|
|
} |
7896
|
|
|
|
7897
|
|
|
// Field function returns field value. |
7898
|
|
|
func (e BundleWriteRequestValidationError) Field() string { return e.field } |
7899
|
|
|
|
7900
|
|
|
// Reason function returns reason value. |
7901
|
|
|
func (e BundleWriteRequestValidationError) Reason() string { return e.reason } |
7902
|
|
|
|
7903
|
|
|
// Cause function returns cause value. |
7904
|
|
|
func (e BundleWriteRequestValidationError) Cause() error { return e.cause } |
7905
|
|
|
|
7906
|
|
|
// Key function returns key value. |
7907
|
|
|
func (e BundleWriteRequestValidationError) Key() bool { return e.key } |
7908
|
|
|
|
7909
|
|
|
// ErrorName returns error name. |
7910
|
|
|
func (e BundleWriteRequestValidationError) ErrorName() string { |
7911
|
|
|
return "BundleWriteRequestValidationError" |
7912
|
|
|
} |
7913
|
|
|
|
7914
|
|
|
// Error satisfies the builtin error interface |
7915
|
|
|
func (e BundleWriteRequestValidationError) Error() string { |
7916
|
|
|
cause := "" |
7917
|
|
|
if e.cause != nil { |
7918
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
7919
|
|
|
} |
7920
|
|
|
|
7921
|
|
|
key := "" |
7922
|
|
|
if e.key { |
7923
|
|
|
key = "key for " |
7924
|
|
|
} |
7925
|
|
|
|
7926
|
|
|
return fmt.Sprintf( |
7927
|
|
|
"invalid %sBundleWriteRequest.%s: %s%s", |
7928
|
|
|
key, |
7929
|
|
|
e.field, |
7930
|
|
|
e.reason, |
7931
|
|
|
cause) |
7932
|
|
|
} |
7933
|
|
|
|
7934
|
|
|
var _ error = BundleWriteRequestValidationError{} |
7935
|
|
|
|
7936
|
|
|
var _ interface { |
7937
|
|
|
Field() string |
7938
|
|
|
Reason() string |
7939
|
|
|
Key() bool |
7940
|
|
|
Cause() error |
7941
|
|
|
ErrorName() string |
7942
|
|
|
} = BundleWriteRequestValidationError{} |
7943
|
|
|
|
7944
|
|
|
var _BundleWriteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
7945
|
|
|
|
7946
|
|
|
// Validate checks the field values on BundleWriteResponse with the rules |
7947
|
|
|
// defined in the proto definition for this message. If any rules are |
7948
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
7949
|
|
|
func (m *BundleWriteResponse) Validate() error { |
7950
|
|
|
return m.validate(false) |
7951
|
|
|
} |
7952
|
|
|
|
7953
|
|
|
// ValidateAll checks the field values on BundleWriteResponse with the rules |
7954
|
|
|
// defined in the proto definition for this message. If any rules are |
7955
|
|
|
// violated, the result is a list of violation errors wrapped in |
7956
|
|
|
// BundleWriteResponseMultiError, or nil if none found. |
7957
|
|
|
func (m *BundleWriteResponse) ValidateAll() error { |
7958
|
|
|
return m.validate(true) |
7959
|
|
|
} |
7960
|
|
|
|
7961
|
|
|
func (m *BundleWriteResponse) validate(all bool) error { |
7962
|
|
|
if m == nil { |
7963
|
|
|
return nil |
7964
|
|
|
} |
7965
|
|
|
|
7966
|
|
|
var errors []error |
7967
|
|
|
|
7968
|
|
|
if len(errors) > 0 { |
7969
|
|
|
return BundleWriteResponseMultiError(errors) |
7970
|
|
|
} |
7971
|
|
|
|
7972
|
|
|
return nil |
7973
|
|
|
} |
7974
|
|
|
|
7975
|
|
|
// BundleWriteResponseMultiError is an error wrapping multiple validation |
7976
|
|
|
// errors returned by BundleWriteResponse.ValidateAll() if the designated |
7977
|
|
|
// constraints aren't met. |
7978
|
|
|
type BundleWriteResponseMultiError []error |
7979
|
|
|
|
7980
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
7981
|
|
|
func (m BundleWriteResponseMultiError) Error() string { |
7982
|
|
|
var msgs []string |
7983
|
|
|
for _, err := range m { |
7984
|
|
|
msgs = append(msgs, err.Error()) |
7985
|
|
|
} |
7986
|
|
|
return strings.Join(msgs, "; ") |
7987
|
|
|
} |
7988
|
|
|
|
7989
|
|
|
// AllErrors returns a list of validation violation errors. |
7990
|
|
|
func (m BundleWriteResponseMultiError) AllErrors() []error { return m } |
7991
|
|
|
|
7992
|
|
|
// BundleWriteResponseValidationError is the validation error returned by |
7993
|
|
|
// BundleWriteResponse.Validate if the designated constraints aren't met. |
7994
|
|
|
type BundleWriteResponseValidationError struct { |
7995
|
|
|
field string |
7996
|
|
|
reason string |
7997
|
|
|
cause error |
7998
|
|
|
key bool |
7999
|
|
|
} |
8000
|
|
|
|
8001
|
|
|
// Field function returns field value. |
8002
|
|
|
func (e BundleWriteResponseValidationError) Field() string { return e.field } |
8003
|
|
|
|
8004
|
|
|
// Reason function returns reason value. |
8005
|
|
|
func (e BundleWriteResponseValidationError) Reason() string { return e.reason } |
8006
|
|
|
|
8007
|
|
|
// Cause function returns cause value. |
8008
|
|
|
func (e BundleWriteResponseValidationError) Cause() error { return e.cause } |
8009
|
|
|
|
8010
|
|
|
// Key function returns key value. |
8011
|
|
|
func (e BundleWriteResponseValidationError) Key() bool { return e.key } |
8012
|
|
|
|
8013
|
|
|
// ErrorName returns error name. |
8014
|
|
|
func (e BundleWriteResponseValidationError) ErrorName() string { |
8015
|
|
|
return "BundleWriteResponseValidationError" |
8016
|
|
|
} |
8017
|
|
|
|
8018
|
|
|
// Error satisfies the builtin error interface |
8019
|
|
|
func (e BundleWriteResponseValidationError) Error() string { |
8020
|
|
|
cause := "" |
8021
|
|
|
if e.cause != nil { |
8022
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8023
|
|
|
} |
8024
|
|
|
|
8025
|
|
|
key := "" |
8026
|
|
|
if e.key { |
8027
|
|
|
key = "key for " |
8028
|
|
|
} |
8029
|
|
|
|
8030
|
|
|
return fmt.Sprintf( |
8031
|
|
|
"invalid %sBundleWriteResponse.%s: %s%s", |
8032
|
|
|
key, |
8033
|
|
|
e.field, |
8034
|
|
|
e.reason, |
8035
|
|
|
cause) |
8036
|
|
|
} |
8037
|
|
|
|
8038
|
|
|
var _ error = BundleWriteResponseValidationError{} |
8039
|
|
|
|
8040
|
|
|
var _ interface { |
8041
|
|
|
Field() string |
8042
|
|
|
Reason() string |
8043
|
|
|
Key() bool |
8044
|
|
|
Cause() error |
8045
|
|
|
ErrorName() string |
8046
|
|
|
} = BundleWriteResponseValidationError{} |
8047
|
|
|
|
8048
|
|
|
// Validate checks the field values on BundleReadRequest with the rules defined |
8049
|
|
|
// in the proto definition for this message. If any rules are violated, the |
8050
|
|
|
// first error encountered is returned, or nil if there are no violations. |
8051
|
|
|
func (m *BundleReadRequest) Validate() error { |
8052
|
|
|
return m.validate(false) |
8053
|
|
|
} |
8054
|
|
|
|
8055
|
|
|
// ValidateAll checks the field values on BundleReadRequest with the rules |
8056
|
|
|
// defined in the proto definition for this message. If any rules are |
8057
|
|
|
// violated, the result is a list of violation errors wrapped in |
8058
|
|
|
// BundleReadRequestMultiError, or nil if none found. |
8059
|
|
|
func (m *BundleReadRequest) ValidateAll() error { |
8060
|
|
|
return m.validate(true) |
8061
|
|
|
} |
8062
|
|
|
|
8063
|
|
|
func (m *BundleReadRequest) validate(all bool) error { |
8064
|
|
|
if m == nil { |
8065
|
|
|
return nil |
8066
|
|
|
} |
8067
|
|
|
|
8068
|
|
|
var errors []error |
8069
|
|
|
|
8070
|
|
|
if len(m.GetTenantId()) > 128 { |
8071
|
|
|
err := BundleReadRequestValidationError{ |
8072
|
|
|
field: "TenantId", |
8073
|
|
|
reason: "value length must be at most 128 bytes", |
8074
|
|
|
} |
8075
|
|
|
if !all { |
8076
|
|
|
return err |
8077
|
|
|
} |
8078
|
|
|
errors = append(errors, err) |
8079
|
|
|
} |
8080
|
|
|
|
8081
|
|
|
if !_BundleReadRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8082
|
|
|
err := BundleReadRequestValidationError{ |
8083
|
|
|
field: "TenantId", |
8084
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8085
|
|
|
} |
8086
|
|
|
if !all { |
8087
|
|
|
return err |
8088
|
|
|
} |
8089
|
|
|
errors = append(errors, err) |
8090
|
|
|
} |
8091
|
|
|
|
8092
|
|
|
// no validation rules for Name |
8093
|
|
|
|
8094
|
|
|
if len(errors) > 0 { |
8095
|
|
|
return BundleReadRequestMultiError(errors) |
8096
|
|
|
} |
8097
|
|
|
|
8098
|
|
|
return nil |
8099
|
|
|
} |
8100
|
|
|
|
8101
|
|
|
// BundleReadRequestMultiError is an error wrapping multiple validation errors |
8102
|
|
|
// returned by BundleReadRequest.ValidateAll() if the designated constraints |
8103
|
|
|
// aren't met. |
8104
|
|
|
type BundleReadRequestMultiError []error |
8105
|
|
|
|
8106
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8107
|
|
|
func (m BundleReadRequestMultiError) Error() string { |
8108
|
|
|
var msgs []string |
8109
|
|
|
for _, err := range m { |
8110
|
|
|
msgs = append(msgs, err.Error()) |
8111
|
|
|
} |
8112
|
|
|
return strings.Join(msgs, "; ") |
8113
|
|
|
} |
8114
|
|
|
|
8115
|
|
|
// AllErrors returns a list of validation violation errors. |
8116
|
|
|
func (m BundleReadRequestMultiError) AllErrors() []error { return m } |
8117
|
|
|
|
8118
|
|
|
// BundleReadRequestValidationError is the validation error returned by |
8119
|
|
|
// BundleReadRequest.Validate if the designated constraints aren't met. |
8120
|
|
|
type BundleReadRequestValidationError struct { |
8121
|
|
|
field string |
8122
|
|
|
reason string |
8123
|
|
|
cause error |
8124
|
|
|
key bool |
8125
|
|
|
} |
8126
|
|
|
|
8127
|
|
|
// Field function returns field value. |
8128
|
|
|
func (e BundleReadRequestValidationError) Field() string { return e.field } |
8129
|
|
|
|
8130
|
|
|
// Reason function returns reason value. |
8131
|
|
|
func (e BundleReadRequestValidationError) Reason() string { return e.reason } |
8132
|
|
|
|
8133
|
|
|
// Cause function returns cause value. |
8134
|
|
|
func (e BundleReadRequestValidationError) Cause() error { return e.cause } |
8135
|
|
|
|
8136
|
|
|
// Key function returns key value. |
8137
|
|
|
func (e BundleReadRequestValidationError) Key() bool { return e.key } |
8138
|
|
|
|
8139
|
|
|
// ErrorName returns error name. |
8140
|
|
|
func (e BundleReadRequestValidationError) ErrorName() string { |
8141
|
|
|
return "BundleReadRequestValidationError" |
8142
|
|
|
} |
8143
|
|
|
|
8144
|
|
|
// Error satisfies the builtin error interface |
8145
|
|
|
func (e BundleReadRequestValidationError) Error() string { |
8146
|
|
|
cause := "" |
8147
|
|
|
if e.cause != nil { |
8148
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8149
|
|
|
} |
8150
|
|
|
|
8151
|
|
|
key := "" |
8152
|
|
|
if e.key { |
8153
|
|
|
key = "key for " |
8154
|
|
|
} |
8155
|
|
|
|
8156
|
|
|
return fmt.Sprintf( |
8157
|
|
|
"invalid %sBundleReadRequest.%s: %s%s", |
8158
|
|
|
key, |
8159
|
|
|
e.field, |
8160
|
|
|
e.reason, |
8161
|
|
|
cause) |
8162
|
|
|
} |
8163
|
|
|
|
8164
|
|
|
var _ error = BundleReadRequestValidationError{} |
8165
|
|
|
|
8166
|
|
|
var _ interface { |
8167
|
|
|
Field() string |
8168
|
|
|
Reason() string |
8169
|
|
|
Key() bool |
8170
|
|
|
Cause() error |
8171
|
|
|
ErrorName() string |
8172
|
|
|
} = BundleReadRequestValidationError{} |
8173
|
|
|
|
8174
|
|
|
var _BundleReadRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8175
|
|
|
|
8176
|
|
|
// Validate checks the field values on BundleReadResponse with the rules |
8177
|
|
|
// defined in the proto definition for this message. If any rules are |
8178
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8179
|
|
|
func (m *BundleReadResponse) Validate() error { |
8180
|
|
|
return m.validate(false) |
8181
|
|
|
} |
8182
|
|
|
|
8183
|
|
|
// ValidateAll checks the field values on BundleReadResponse with the rules |
8184
|
|
|
// defined in the proto definition for this message. If any rules are |
8185
|
|
|
// violated, the result is a list of violation errors wrapped in |
8186
|
|
|
// BundleReadResponseMultiError, or nil if none found. |
8187
|
|
|
func (m *BundleReadResponse) ValidateAll() error { |
8188
|
|
|
return m.validate(true) |
8189
|
|
|
} |
8190
|
|
|
|
8191
|
|
|
func (m *BundleReadResponse) validate(all bool) error { |
8192
|
|
|
if m == nil { |
8193
|
|
|
return nil |
8194
|
|
|
} |
8195
|
|
|
|
8196
|
|
|
var errors []error |
8197
|
|
|
|
8198
|
|
|
if all { |
8199
|
|
|
switch v := interface{}(m.GetBundle()).(type) { |
8200
|
|
|
case interface{ ValidateAll() error }: |
8201
|
|
|
if err := v.ValidateAll(); err != nil { |
8202
|
|
|
errors = append(errors, BundleReadResponseValidationError{ |
8203
|
|
|
field: "Bundle", |
8204
|
|
|
reason: "embedded message failed validation", |
8205
|
|
|
cause: err, |
8206
|
|
|
}) |
8207
|
|
|
} |
8208
|
|
|
case interface{ Validate() error }: |
8209
|
|
|
if err := v.Validate(); err != nil { |
8210
|
|
|
errors = append(errors, BundleReadResponseValidationError{ |
8211
|
|
|
field: "Bundle", |
8212
|
|
|
reason: "embedded message failed validation", |
8213
|
|
|
cause: err, |
8214
|
|
|
}) |
8215
|
|
|
} |
8216
|
|
|
} |
8217
|
|
|
} else if v, ok := interface{}(m.GetBundle()).(interface{ Validate() error }); ok { |
8218
|
|
|
if err := v.Validate(); err != nil { |
8219
|
|
|
return BundleReadResponseValidationError{ |
8220
|
|
|
field: "Bundle", |
8221
|
|
|
reason: "embedded message failed validation", |
8222
|
|
|
cause: err, |
8223
|
|
|
} |
8224
|
|
|
} |
8225
|
|
|
} |
8226
|
|
|
|
8227
|
|
|
if len(errors) > 0 { |
8228
|
|
|
return BundleReadResponseMultiError(errors) |
8229
|
|
|
} |
8230
|
|
|
|
8231
|
|
|
return nil |
8232
|
|
|
} |
8233
|
|
|
|
8234
|
|
|
// BundleReadResponseMultiError is an error wrapping multiple validation errors |
8235
|
|
|
// returned by BundleReadResponse.ValidateAll() if the designated constraints |
8236
|
|
|
// aren't met. |
8237
|
|
|
type BundleReadResponseMultiError []error |
8238
|
|
|
|
8239
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8240
|
|
|
func (m BundleReadResponseMultiError) Error() string { |
8241
|
|
|
var msgs []string |
8242
|
|
|
for _, err := range m { |
8243
|
|
|
msgs = append(msgs, err.Error()) |
8244
|
|
|
} |
8245
|
|
|
return strings.Join(msgs, "; ") |
8246
|
|
|
} |
8247
|
|
|
|
8248
|
|
|
// AllErrors returns a list of validation violation errors. |
8249
|
|
|
func (m BundleReadResponseMultiError) AllErrors() []error { return m } |
8250
|
|
|
|
8251
|
|
|
// BundleReadResponseValidationError is the validation error returned by |
8252
|
|
|
// BundleReadResponse.Validate if the designated constraints aren't met. |
8253
|
|
|
type BundleReadResponseValidationError struct { |
8254
|
|
|
field string |
8255
|
|
|
reason string |
8256
|
|
|
cause error |
8257
|
|
|
key bool |
8258
|
|
|
} |
8259
|
|
|
|
8260
|
|
|
// Field function returns field value. |
8261
|
|
|
func (e BundleReadResponseValidationError) Field() string { return e.field } |
8262
|
|
|
|
8263
|
|
|
// Reason function returns reason value. |
8264
|
|
|
func (e BundleReadResponseValidationError) Reason() string { return e.reason } |
8265
|
|
|
|
8266
|
|
|
// Cause function returns cause value. |
8267
|
|
|
func (e BundleReadResponseValidationError) Cause() error { return e.cause } |
8268
|
|
|
|
8269
|
|
|
// Key function returns key value. |
8270
|
|
|
func (e BundleReadResponseValidationError) Key() bool { return e.key } |
8271
|
|
|
|
8272
|
|
|
// ErrorName returns error name. |
8273
|
|
|
func (e BundleReadResponseValidationError) ErrorName() string { |
8274
|
|
|
return "BundleReadResponseValidationError" |
8275
|
|
|
} |
8276
|
|
|
|
8277
|
|
|
// Error satisfies the builtin error interface |
8278
|
|
|
func (e BundleReadResponseValidationError) Error() string { |
8279
|
|
|
cause := "" |
8280
|
|
|
if e.cause != nil { |
8281
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8282
|
|
|
} |
8283
|
|
|
|
8284
|
|
|
key := "" |
8285
|
|
|
if e.key { |
8286
|
|
|
key = "key for " |
8287
|
|
|
} |
8288
|
|
|
|
8289
|
|
|
return fmt.Sprintf( |
8290
|
|
|
"invalid %sBundleReadResponse.%s: %s%s", |
8291
|
|
|
key, |
8292
|
|
|
e.field, |
8293
|
|
|
e.reason, |
8294
|
|
|
cause) |
8295
|
|
|
} |
8296
|
|
|
|
8297
|
|
|
var _ error = BundleReadResponseValidationError{} |
8298
|
|
|
|
8299
|
|
|
var _ interface { |
8300
|
|
|
Field() string |
8301
|
|
|
Reason() string |
8302
|
|
|
Key() bool |
8303
|
|
|
Cause() error |
8304
|
|
|
ErrorName() string |
8305
|
|
|
} = BundleReadResponseValidationError{} |
8306
|
|
|
|
8307
|
|
|
// Validate checks the field values on BundleDeleteRequest with the rules |
8308
|
|
|
// defined in the proto definition for this message. If any rules are |
8309
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8310
|
|
|
func (m *BundleDeleteRequest) Validate() error { |
8311
|
|
|
return m.validate(false) |
8312
|
|
|
} |
8313
|
|
|
|
8314
|
|
|
// ValidateAll checks the field values on BundleDeleteRequest with the rules |
8315
|
|
|
// defined in the proto definition for this message. If any rules are |
8316
|
|
|
// violated, the result is a list of violation errors wrapped in |
8317
|
|
|
// BundleDeleteRequestMultiError, or nil if none found. |
8318
|
|
|
func (m *BundleDeleteRequest) ValidateAll() error { |
8319
|
|
|
return m.validate(true) |
8320
|
|
|
} |
8321
|
|
|
|
8322
|
|
|
func (m *BundleDeleteRequest) validate(all bool) error { |
8323
|
|
|
if m == nil { |
8324
|
|
|
return nil |
8325
|
|
|
} |
8326
|
|
|
|
8327
|
|
|
var errors []error |
8328
|
|
|
|
8329
|
|
|
if len(m.GetTenantId()) > 128 { |
8330
|
|
|
err := BundleDeleteRequestValidationError{ |
8331
|
|
|
field: "TenantId", |
8332
|
|
|
reason: "value length must be at most 128 bytes", |
8333
|
|
|
} |
8334
|
|
|
if !all { |
8335
|
|
|
return err |
8336
|
|
|
} |
8337
|
|
|
errors = append(errors, err) |
8338
|
|
|
} |
8339
|
|
|
|
8340
|
|
|
if !_BundleDeleteRequest_TenantId_Pattern.MatchString(m.GetTenantId()) { |
8341
|
|
|
err := BundleDeleteRequestValidationError{ |
8342
|
|
|
field: "TenantId", |
8343
|
|
|
reason: "value does not match regex pattern \"^([a-zA-Z0-9_\\\\-@\\\\.:+]{1,128}|\\\\*)$\"", |
8344
|
|
|
} |
8345
|
|
|
if !all { |
8346
|
|
|
return err |
8347
|
|
|
} |
8348
|
|
|
errors = append(errors, err) |
8349
|
|
|
} |
8350
|
|
|
|
8351
|
|
|
// no validation rules for Name |
8352
|
|
|
|
8353
|
|
|
if len(errors) > 0 { |
8354
|
|
|
return BundleDeleteRequestMultiError(errors) |
8355
|
|
|
} |
8356
|
|
|
|
8357
|
|
|
return nil |
8358
|
|
|
} |
8359
|
|
|
|
8360
|
|
|
// BundleDeleteRequestMultiError is an error wrapping multiple validation |
8361
|
|
|
// errors returned by BundleDeleteRequest.ValidateAll() if the designated |
8362
|
|
|
// constraints aren't met. |
8363
|
|
|
type BundleDeleteRequestMultiError []error |
8364
|
|
|
|
8365
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8366
|
|
|
func (m BundleDeleteRequestMultiError) Error() string { |
8367
|
|
|
var msgs []string |
8368
|
|
|
for _, err := range m { |
8369
|
|
|
msgs = append(msgs, err.Error()) |
8370
|
|
|
} |
8371
|
|
|
return strings.Join(msgs, "; ") |
8372
|
|
|
} |
8373
|
|
|
|
8374
|
|
|
// AllErrors returns a list of validation violation errors. |
8375
|
|
|
func (m BundleDeleteRequestMultiError) AllErrors() []error { return m } |
8376
|
|
|
|
8377
|
|
|
// BundleDeleteRequestValidationError is the validation error returned by |
8378
|
|
|
// BundleDeleteRequest.Validate if the designated constraints aren't met. |
8379
|
|
|
type BundleDeleteRequestValidationError struct { |
8380
|
|
|
field string |
8381
|
|
|
reason string |
8382
|
|
|
cause error |
8383
|
|
|
key bool |
8384
|
|
|
} |
8385
|
|
|
|
8386
|
|
|
// Field function returns field value. |
8387
|
|
|
func (e BundleDeleteRequestValidationError) Field() string { return e.field } |
8388
|
|
|
|
8389
|
|
|
// Reason function returns reason value. |
8390
|
|
|
func (e BundleDeleteRequestValidationError) Reason() string { return e.reason } |
8391
|
|
|
|
8392
|
|
|
// Cause function returns cause value. |
8393
|
|
|
func (e BundleDeleteRequestValidationError) Cause() error { return e.cause } |
8394
|
|
|
|
8395
|
|
|
// Key function returns key value. |
8396
|
|
|
func (e BundleDeleteRequestValidationError) Key() bool { return e.key } |
8397
|
|
|
|
8398
|
|
|
// ErrorName returns error name. |
8399
|
|
|
func (e BundleDeleteRequestValidationError) ErrorName() string { |
8400
|
|
|
return "BundleDeleteRequestValidationError" |
8401
|
|
|
} |
8402
|
|
|
|
8403
|
|
|
// Error satisfies the builtin error interface |
8404
|
|
|
func (e BundleDeleteRequestValidationError) Error() string { |
8405
|
|
|
cause := "" |
8406
|
|
|
if e.cause != nil { |
8407
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8408
|
|
|
} |
8409
|
|
|
|
8410
|
|
|
key := "" |
8411
|
|
|
if e.key { |
8412
|
|
|
key = "key for " |
8413
|
|
|
} |
8414
|
|
|
|
8415
|
|
|
return fmt.Sprintf( |
8416
|
|
|
"invalid %sBundleDeleteRequest.%s: %s%s", |
8417
|
|
|
key, |
8418
|
|
|
e.field, |
8419
|
|
|
e.reason, |
8420
|
|
|
cause) |
8421
|
|
|
} |
8422
|
|
|
|
8423
|
|
|
var _ error = BundleDeleteRequestValidationError{} |
8424
|
|
|
|
8425
|
|
|
var _ interface { |
8426
|
|
|
Field() string |
8427
|
|
|
Reason() string |
8428
|
|
|
Key() bool |
8429
|
|
|
Cause() error |
8430
|
|
|
ErrorName() string |
8431
|
|
|
} = BundleDeleteRequestValidationError{} |
8432
|
|
|
|
8433
|
|
|
var _BundleDeleteRequest_TenantId_Pattern = regexp.MustCompile("^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$") |
8434
|
|
|
|
8435
|
|
|
// Validate checks the field values on BundleDeleteResponse with the rules |
8436
|
|
|
// defined in the proto definition for this message. If any rules are |
8437
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8438
|
|
|
func (m *BundleDeleteResponse) Validate() error { |
8439
|
|
|
return m.validate(false) |
8440
|
|
|
} |
8441
|
|
|
|
8442
|
|
|
// ValidateAll checks the field values on BundleDeleteResponse with the rules |
8443
|
|
|
// defined in the proto definition for this message. If any rules are |
8444
|
|
|
// violated, the result is a list of violation errors wrapped in |
8445
|
|
|
// BundleDeleteResponseMultiError, or nil if none found. |
8446
|
|
|
func (m *BundleDeleteResponse) ValidateAll() error { |
8447
|
|
|
return m.validate(true) |
8448
|
|
|
} |
8449
|
|
|
|
8450
|
|
|
func (m *BundleDeleteResponse) validate(all bool) error { |
8451
|
|
|
if m == nil { |
8452
|
|
|
return nil |
8453
|
|
|
} |
8454
|
|
|
|
8455
|
|
|
var errors []error |
8456
|
|
|
|
8457
|
|
|
// no validation rules for Name |
8458
|
|
|
|
8459
|
|
|
if len(errors) > 0 { |
8460
|
|
|
return BundleDeleteResponseMultiError(errors) |
8461
|
|
|
} |
8462
|
|
|
|
8463
|
|
|
return nil |
8464
|
|
|
} |
8465
|
|
|
|
8466
|
|
|
// BundleDeleteResponseMultiError is an error wrapping multiple validation |
8467
|
|
|
// errors returned by BundleDeleteResponse.ValidateAll() if the designated |
8468
|
|
|
// constraints aren't met. |
8469
|
|
|
type BundleDeleteResponseMultiError []error |
8470
|
|
|
|
8471
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8472
|
|
|
func (m BundleDeleteResponseMultiError) Error() string { |
8473
|
|
|
var msgs []string |
8474
|
|
|
for _, err := range m { |
8475
|
|
|
msgs = append(msgs, err.Error()) |
8476
|
|
|
} |
8477
|
|
|
return strings.Join(msgs, "; ") |
8478
|
|
|
} |
8479
|
|
|
|
8480
|
|
|
// AllErrors returns a list of validation violation errors. |
8481
|
|
|
func (m BundleDeleteResponseMultiError) AllErrors() []error { return m } |
8482
|
|
|
|
8483
|
|
|
// BundleDeleteResponseValidationError is the validation error returned by |
8484
|
|
|
// BundleDeleteResponse.Validate if the designated constraints aren't met. |
8485
|
|
|
type BundleDeleteResponseValidationError struct { |
8486
|
|
|
field string |
8487
|
|
|
reason string |
8488
|
|
|
cause error |
8489
|
|
|
key bool |
8490
|
|
|
} |
8491
|
|
|
|
8492
|
|
|
// Field function returns field value. |
8493
|
|
|
func (e BundleDeleteResponseValidationError) Field() string { return e.field } |
8494
|
|
|
|
8495
|
|
|
// Reason function returns reason value. |
8496
|
|
|
func (e BundleDeleteResponseValidationError) Reason() string { return e.reason } |
8497
|
|
|
|
8498
|
|
|
// Cause function returns cause value. |
8499
|
|
|
func (e BundleDeleteResponseValidationError) Cause() error { return e.cause } |
8500
|
|
|
|
8501
|
|
|
// Key function returns key value. |
8502
|
|
|
func (e BundleDeleteResponseValidationError) Key() bool { return e.key } |
8503
|
|
|
|
8504
|
|
|
// ErrorName returns error name. |
8505
|
|
|
func (e BundleDeleteResponseValidationError) ErrorName() string { |
8506
|
|
|
return "BundleDeleteResponseValidationError" |
8507
|
|
|
} |
8508
|
|
|
|
8509
|
|
|
// Error satisfies the builtin error interface |
8510
|
|
|
func (e BundleDeleteResponseValidationError) Error() string { |
8511
|
|
|
cause := "" |
8512
|
|
|
if e.cause != nil { |
8513
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8514
|
|
|
} |
8515
|
|
|
|
8516
|
|
|
key := "" |
8517
|
|
|
if e.key { |
8518
|
|
|
key = "key for " |
8519
|
|
|
} |
8520
|
|
|
|
8521
|
|
|
return fmt.Sprintf( |
8522
|
|
|
"invalid %sBundleDeleteResponse.%s: %s%s", |
8523
|
|
|
key, |
8524
|
|
|
e.field, |
8525
|
|
|
e.reason, |
8526
|
|
|
cause) |
8527
|
|
|
} |
8528
|
|
|
|
8529
|
|
|
var _ error = BundleDeleteResponseValidationError{} |
8530
|
|
|
|
8531
|
|
|
var _ interface { |
8532
|
|
|
Field() string |
8533
|
|
|
Reason() string |
8534
|
|
|
Key() bool |
8535
|
|
|
Cause() error |
8536
|
|
|
ErrorName() string |
8537
|
|
|
} = BundleDeleteResponseValidationError{} |
8538
|
|
|
|
8539
|
|
|
// Validate checks the field values on TenantCreateRequest with the rules |
8540
|
|
|
// defined in the proto definition for this message. If any rules are |
8541
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8542
|
|
|
func (m *TenantCreateRequest) Validate() error { |
8543
|
|
|
return m.validate(false) |
8544
|
|
|
} |
8545
|
|
|
|
8546
|
|
|
// ValidateAll checks the field values on TenantCreateRequest with the rules |
8547
|
|
|
// defined in the proto definition for this message. If any rules are |
8548
|
|
|
// violated, the result is a list of violation errors wrapped in |
8549
|
|
|
// TenantCreateRequestMultiError, or nil if none found. |
8550
|
|
|
func (m *TenantCreateRequest) ValidateAll() error { |
8551
|
|
|
return m.validate(true) |
8552
|
|
|
} |
8553
|
|
|
|
8554
|
|
|
func (m *TenantCreateRequest) validate(all bool) error { |
8555
|
|
|
if m == nil { |
8556
|
|
|
return nil |
8557
|
|
|
} |
8558
|
|
|
|
8559
|
|
|
var errors []error |
8560
|
|
|
|
8561
|
|
|
if len(m.GetId()) > 64 { |
8562
|
|
|
err := TenantCreateRequestValidationError{ |
8563
|
|
|
field: "Id", |
8564
|
|
|
reason: "value length must be at most 64 bytes", |
8565
|
|
|
} |
8566
|
|
|
if !all { |
8567
|
|
|
return err |
8568
|
|
|
} |
8569
|
|
|
errors = append(errors, err) |
8570
|
|
|
} |
8571
|
|
|
|
8572
|
|
|
if !_TenantCreateRequest_Id_Pattern.MatchString(m.GetId()) { |
8573
|
|
|
err := TenantCreateRequestValidationError{ |
8574
|
|
|
field: "Id", |
8575
|
|
|
reason: "value does not match regex pattern \"[a-zA-Z0-9-,]+\"", |
8576
|
|
|
} |
8577
|
|
|
if !all { |
8578
|
|
|
return err |
8579
|
|
|
} |
8580
|
|
|
errors = append(errors, err) |
8581
|
|
|
} |
8582
|
|
|
|
8583
|
|
|
if len(m.GetName()) > 64 { |
8584
|
|
|
err := TenantCreateRequestValidationError{ |
8585
|
|
|
field: "Name", |
8586
|
|
|
reason: "value length must be at most 64 bytes", |
8587
|
|
|
} |
8588
|
|
|
if !all { |
8589
|
|
|
return err |
8590
|
|
|
} |
8591
|
|
|
errors = append(errors, err) |
8592
|
|
|
} |
8593
|
|
|
|
8594
|
|
|
if len(errors) > 0 { |
8595
|
|
|
return TenantCreateRequestMultiError(errors) |
8596
|
|
|
} |
8597
|
|
|
|
8598
|
|
|
return nil |
8599
|
|
|
} |
8600
|
|
|
|
8601
|
|
|
// TenantCreateRequestMultiError is an error wrapping multiple validation |
8602
|
|
|
// errors returned by TenantCreateRequest.ValidateAll() if the designated |
8603
|
|
|
// constraints aren't met. |
8604
|
|
|
type TenantCreateRequestMultiError []error |
8605
|
|
|
|
8606
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8607
|
|
|
func (m TenantCreateRequestMultiError) Error() string { |
8608
|
|
|
var msgs []string |
8609
|
|
|
for _, err := range m { |
8610
|
|
|
msgs = append(msgs, err.Error()) |
8611
|
|
|
} |
8612
|
|
|
return strings.Join(msgs, "; ") |
8613
|
|
|
} |
8614
|
|
|
|
8615
|
|
|
// AllErrors returns a list of validation violation errors. |
8616
|
|
|
func (m TenantCreateRequestMultiError) AllErrors() []error { return m } |
8617
|
|
|
|
8618
|
|
|
// TenantCreateRequestValidationError is the validation error returned by |
8619
|
|
|
// TenantCreateRequest.Validate if the designated constraints aren't met. |
8620
|
|
|
type TenantCreateRequestValidationError struct { |
8621
|
|
|
field string |
8622
|
|
|
reason string |
8623
|
|
|
cause error |
8624
|
|
|
key bool |
8625
|
|
|
} |
8626
|
|
|
|
8627
|
|
|
// Field function returns field value. |
8628
|
|
|
func (e TenantCreateRequestValidationError) Field() string { return e.field } |
8629
|
|
|
|
8630
|
|
|
// Reason function returns reason value. |
8631
|
|
|
func (e TenantCreateRequestValidationError) Reason() string { return e.reason } |
8632
|
|
|
|
8633
|
|
|
// Cause function returns cause value. |
8634
|
|
|
func (e TenantCreateRequestValidationError) Cause() error { return e.cause } |
8635
|
|
|
|
8636
|
|
|
// Key function returns key value. |
8637
|
|
|
func (e TenantCreateRequestValidationError) Key() bool { return e.key } |
8638
|
|
|
|
8639
|
|
|
// ErrorName returns error name. |
8640
|
|
|
func (e TenantCreateRequestValidationError) ErrorName() string { |
8641
|
|
|
return "TenantCreateRequestValidationError" |
8642
|
|
|
} |
8643
|
|
|
|
8644
|
|
|
// Error satisfies the builtin error interface |
8645
|
|
|
func (e TenantCreateRequestValidationError) Error() string { |
8646
|
|
|
cause := "" |
8647
|
|
|
if e.cause != nil { |
8648
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8649
|
|
|
} |
8650
|
|
|
|
8651
|
|
|
key := "" |
8652
|
|
|
if e.key { |
8653
|
|
|
key = "key for " |
8654
|
|
|
} |
8655
|
|
|
|
8656
|
|
|
return fmt.Sprintf( |
8657
|
|
|
"invalid %sTenantCreateRequest.%s: %s%s", |
8658
|
|
|
key, |
8659
|
|
|
e.field, |
8660
|
|
|
e.reason, |
8661
|
|
|
cause) |
8662
|
|
|
} |
8663
|
|
|
|
8664
|
|
|
var _ error = TenantCreateRequestValidationError{} |
8665
|
|
|
|
8666
|
|
|
var _ interface { |
8667
|
|
|
Field() string |
8668
|
|
|
Reason() string |
8669
|
|
|
Key() bool |
8670
|
|
|
Cause() error |
8671
|
|
|
ErrorName() string |
8672
|
|
|
} = TenantCreateRequestValidationError{} |
8673
|
|
|
|
8674
|
|
|
var _TenantCreateRequest_Id_Pattern = regexp.MustCompile("[a-zA-Z0-9-,]+") |
8675
|
|
|
|
8676
|
|
|
// Validate checks the field values on TenantCreateResponse with the rules |
8677
|
|
|
// defined in the proto definition for this message. If any rules are |
8678
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8679
|
|
|
func (m *TenantCreateResponse) Validate() error { |
8680
|
|
|
return m.validate(false) |
8681
|
|
|
} |
8682
|
|
|
|
8683
|
|
|
// ValidateAll checks the field values on TenantCreateResponse with the rules |
8684
|
|
|
// defined in the proto definition for this message. If any rules are |
8685
|
|
|
// violated, the result is a list of violation errors wrapped in |
8686
|
|
|
// TenantCreateResponseMultiError, or nil if none found. |
8687
|
|
|
func (m *TenantCreateResponse) ValidateAll() error { |
8688
|
|
|
return m.validate(true) |
8689
|
|
|
} |
8690
|
|
|
|
8691
|
|
|
func (m *TenantCreateResponse) validate(all bool) error { |
8692
|
|
|
if m == nil { |
8693
|
|
|
return nil |
8694
|
|
|
} |
8695
|
|
|
|
8696
|
|
|
var errors []error |
8697
|
|
|
|
8698
|
|
|
if all { |
8699
|
|
|
switch v := interface{}(m.GetTenant()).(type) { |
8700
|
|
|
case interface{ ValidateAll() error }: |
8701
|
|
|
if err := v.ValidateAll(); err != nil { |
8702
|
|
|
errors = append(errors, TenantCreateResponseValidationError{ |
8703
|
|
|
field: "Tenant", |
8704
|
|
|
reason: "embedded message failed validation", |
8705
|
|
|
cause: err, |
8706
|
|
|
}) |
8707
|
|
|
} |
8708
|
|
|
case interface{ Validate() error }: |
8709
|
|
|
if err := v.Validate(); err != nil { |
8710
|
|
|
errors = append(errors, TenantCreateResponseValidationError{ |
8711
|
|
|
field: "Tenant", |
8712
|
|
|
reason: "embedded message failed validation", |
8713
|
|
|
cause: err, |
8714
|
|
|
}) |
8715
|
|
|
} |
8716
|
|
|
} |
8717
|
|
|
} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok { |
8718
|
|
|
if err := v.Validate(); err != nil { |
8719
|
|
|
return TenantCreateResponseValidationError{ |
8720
|
|
|
field: "Tenant", |
8721
|
|
|
reason: "embedded message failed validation", |
8722
|
|
|
cause: err, |
8723
|
|
|
} |
8724
|
|
|
} |
8725
|
|
|
} |
8726
|
|
|
|
8727
|
|
|
if len(errors) > 0 { |
8728
|
|
|
return TenantCreateResponseMultiError(errors) |
8729
|
|
|
} |
8730
|
|
|
|
8731
|
|
|
return nil |
8732
|
|
|
} |
8733
|
|
|
|
8734
|
|
|
// TenantCreateResponseMultiError is an error wrapping multiple validation |
8735
|
|
|
// errors returned by TenantCreateResponse.ValidateAll() if the designated |
8736
|
|
|
// constraints aren't met. |
8737
|
|
|
type TenantCreateResponseMultiError []error |
8738
|
|
|
|
8739
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8740
|
|
|
func (m TenantCreateResponseMultiError) Error() string { |
8741
|
|
|
var msgs []string |
8742
|
|
|
for _, err := range m { |
8743
|
|
|
msgs = append(msgs, err.Error()) |
8744
|
|
|
} |
8745
|
|
|
return strings.Join(msgs, "; ") |
8746
|
|
|
} |
8747
|
|
|
|
8748
|
|
|
// AllErrors returns a list of validation violation errors. |
8749
|
|
|
func (m TenantCreateResponseMultiError) AllErrors() []error { return m } |
8750
|
|
|
|
8751
|
|
|
// TenantCreateResponseValidationError is the validation error returned by |
8752
|
|
|
// TenantCreateResponse.Validate if the designated constraints aren't met. |
8753
|
|
|
type TenantCreateResponseValidationError struct { |
8754
|
|
|
field string |
8755
|
|
|
reason string |
8756
|
|
|
cause error |
8757
|
|
|
key bool |
8758
|
|
|
} |
8759
|
|
|
|
8760
|
|
|
// Field function returns field value. |
8761
|
|
|
func (e TenantCreateResponseValidationError) Field() string { return e.field } |
8762
|
|
|
|
8763
|
|
|
// Reason function returns reason value. |
8764
|
|
|
func (e TenantCreateResponseValidationError) Reason() string { return e.reason } |
8765
|
|
|
|
8766
|
|
|
// Cause function returns cause value. |
8767
|
|
|
func (e TenantCreateResponseValidationError) Cause() error { return e.cause } |
8768
|
|
|
|
8769
|
|
|
// Key function returns key value. |
8770
|
|
|
func (e TenantCreateResponseValidationError) Key() bool { return e.key } |
8771
|
|
|
|
8772
|
|
|
// ErrorName returns error name. |
8773
|
|
|
func (e TenantCreateResponseValidationError) ErrorName() string { |
8774
|
|
|
return "TenantCreateResponseValidationError" |
8775
|
|
|
} |
8776
|
|
|
|
8777
|
|
|
// Error satisfies the builtin error interface |
8778
|
|
|
func (e TenantCreateResponseValidationError) Error() string { |
8779
|
|
|
cause := "" |
8780
|
|
|
if e.cause != nil { |
8781
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8782
|
|
|
} |
8783
|
|
|
|
8784
|
|
|
key := "" |
8785
|
|
|
if e.key { |
8786
|
|
|
key = "key for " |
8787
|
|
|
} |
8788
|
|
|
|
8789
|
|
|
return fmt.Sprintf( |
8790
|
|
|
"invalid %sTenantCreateResponse.%s: %s%s", |
8791
|
|
|
key, |
8792
|
|
|
e.field, |
8793
|
|
|
e.reason, |
8794
|
|
|
cause) |
8795
|
|
|
} |
8796
|
|
|
|
8797
|
|
|
var _ error = TenantCreateResponseValidationError{} |
8798
|
|
|
|
8799
|
|
|
var _ interface { |
8800
|
|
|
Field() string |
8801
|
|
|
Reason() string |
8802
|
|
|
Key() bool |
8803
|
|
|
Cause() error |
8804
|
|
|
ErrorName() string |
8805
|
|
|
} = TenantCreateResponseValidationError{} |
8806
|
|
|
|
8807
|
|
|
// Validate checks the field values on TenantDeleteRequest with the rules |
8808
|
|
|
// defined in the proto definition for this message. If any rules are |
8809
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8810
|
|
|
func (m *TenantDeleteRequest) Validate() error { |
8811
|
|
|
return m.validate(false) |
8812
|
|
|
} |
8813
|
|
|
|
8814
|
|
|
// ValidateAll checks the field values on TenantDeleteRequest with the rules |
8815
|
|
|
// defined in the proto definition for this message. If any rules are |
8816
|
|
|
// violated, the result is a list of violation errors wrapped in |
8817
|
|
|
// TenantDeleteRequestMultiError, or nil if none found. |
8818
|
|
|
func (m *TenantDeleteRequest) ValidateAll() error { |
8819
|
|
|
return m.validate(true) |
8820
|
|
|
} |
8821
|
|
|
|
8822
|
|
|
func (m *TenantDeleteRequest) validate(all bool) error { |
8823
|
|
|
if m == nil { |
8824
|
|
|
return nil |
8825
|
|
|
} |
8826
|
|
|
|
8827
|
|
|
var errors []error |
8828
|
|
|
|
8829
|
|
|
if len(errors) > 0 { |
8830
|
|
|
return TenantDeleteRequestMultiError(errors) |
8831
|
|
|
} |
8832
|
|
|
|
8833
|
|
|
return nil |
8834
|
|
|
} |
8835
|
|
|
|
8836
|
|
|
// TenantDeleteRequestMultiError is an error wrapping multiple validation |
8837
|
|
|
// errors returned by TenantDeleteRequest.ValidateAll() if the designated |
8838
|
|
|
// constraints aren't met. |
8839
|
|
|
type TenantDeleteRequestMultiError []error |
8840
|
|
|
|
8841
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8842
|
|
|
func (m TenantDeleteRequestMultiError) Error() string { |
8843
|
|
|
var msgs []string |
8844
|
|
|
for _, err := range m { |
8845
|
|
|
msgs = append(msgs, err.Error()) |
8846
|
|
|
} |
8847
|
|
|
return strings.Join(msgs, "; ") |
8848
|
|
|
} |
8849
|
|
|
|
8850
|
|
|
// AllErrors returns a list of validation violation errors. |
8851
|
|
|
func (m TenantDeleteRequestMultiError) AllErrors() []error { return m } |
8852
|
|
|
|
8853
|
|
|
// TenantDeleteRequestValidationError is the validation error returned by |
8854
|
|
|
// TenantDeleteRequest.Validate if the designated constraints aren't met. |
8855
|
|
|
type TenantDeleteRequestValidationError struct { |
8856
|
|
|
field string |
8857
|
|
|
reason string |
8858
|
|
|
cause error |
8859
|
|
|
key bool |
8860
|
|
|
} |
8861
|
|
|
|
8862
|
|
|
// Field function returns field value. |
8863
|
|
|
func (e TenantDeleteRequestValidationError) Field() string { return e.field } |
8864
|
|
|
|
8865
|
|
|
// Reason function returns reason value. |
8866
|
|
|
func (e TenantDeleteRequestValidationError) Reason() string { return e.reason } |
8867
|
|
|
|
8868
|
|
|
// Cause function returns cause value. |
8869
|
|
|
func (e TenantDeleteRequestValidationError) Cause() error { return e.cause } |
8870
|
|
|
|
8871
|
|
|
// Key function returns key value. |
8872
|
|
|
func (e TenantDeleteRequestValidationError) Key() bool { return e.key } |
8873
|
|
|
|
8874
|
|
|
// ErrorName returns error name. |
8875
|
|
|
func (e TenantDeleteRequestValidationError) ErrorName() string { |
8876
|
|
|
return "TenantDeleteRequestValidationError" |
8877
|
|
|
} |
8878
|
|
|
|
8879
|
|
|
// Error satisfies the builtin error interface |
8880
|
|
|
func (e TenantDeleteRequestValidationError) Error() string { |
8881
|
|
|
cause := "" |
8882
|
|
|
if e.cause != nil { |
8883
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
8884
|
|
|
} |
8885
|
|
|
|
8886
|
|
|
key := "" |
8887
|
|
|
if e.key { |
8888
|
|
|
key = "key for " |
8889
|
|
|
} |
8890
|
|
|
|
8891
|
|
|
return fmt.Sprintf( |
8892
|
|
|
"invalid %sTenantDeleteRequest.%s: %s%s", |
8893
|
|
|
key, |
8894
|
|
|
e.field, |
8895
|
|
|
e.reason, |
8896
|
|
|
cause) |
8897
|
|
|
} |
8898
|
|
|
|
8899
|
|
|
var _ error = TenantDeleteRequestValidationError{} |
8900
|
|
|
|
8901
|
|
|
var _ interface { |
8902
|
|
|
Field() string |
8903
|
|
|
Reason() string |
8904
|
|
|
Key() bool |
8905
|
|
|
Cause() error |
8906
|
|
|
ErrorName() string |
8907
|
|
|
} = TenantDeleteRequestValidationError{} |
8908
|
|
|
|
8909
|
|
|
// Validate checks the field values on TenantDeleteResponse with the rules |
8910
|
|
|
// defined in the proto definition for this message. If any rules are |
8911
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
8912
|
|
|
func (m *TenantDeleteResponse) Validate() error { |
8913
|
|
|
return m.validate(false) |
8914
|
|
|
} |
8915
|
|
|
|
8916
|
|
|
// ValidateAll checks the field values on TenantDeleteResponse with the rules |
8917
|
|
|
// defined in the proto definition for this message. If any rules are |
8918
|
|
|
// violated, the result is a list of violation errors wrapped in |
8919
|
|
|
// TenantDeleteResponseMultiError, or nil if none found. |
8920
|
|
|
func (m *TenantDeleteResponse) ValidateAll() error { |
8921
|
|
|
return m.validate(true) |
8922
|
|
|
} |
8923
|
|
|
|
8924
|
|
|
func (m *TenantDeleteResponse) validate(all bool) error { |
8925
|
|
|
if m == nil { |
8926
|
|
|
return nil |
8927
|
|
|
} |
8928
|
|
|
|
8929
|
|
|
var errors []error |
8930
|
|
|
|
8931
|
|
|
if all { |
8932
|
|
|
switch v := interface{}(m.GetTenant()).(type) { |
8933
|
|
|
case interface{ ValidateAll() error }: |
8934
|
|
|
if err := v.ValidateAll(); err != nil { |
8935
|
|
|
errors = append(errors, TenantDeleteResponseValidationError{ |
8936
|
|
|
field: "Tenant", |
8937
|
|
|
reason: "embedded message failed validation", |
8938
|
|
|
cause: err, |
8939
|
|
|
}) |
8940
|
|
|
} |
8941
|
|
|
case interface{ Validate() error }: |
8942
|
|
|
if err := v.Validate(); err != nil { |
8943
|
|
|
errors = append(errors, TenantDeleteResponseValidationError{ |
8944
|
|
|
field: "Tenant", |
8945
|
|
|
reason: "embedded message failed validation", |
8946
|
|
|
cause: err, |
8947
|
|
|
}) |
8948
|
|
|
} |
8949
|
|
|
} |
8950
|
|
|
} else if v, ok := interface{}(m.GetTenant()).(interface{ Validate() error }); ok { |
8951
|
|
|
if err := v.Validate(); err != nil { |
8952
|
|
|
return TenantDeleteResponseValidationError{ |
8953
|
|
|
field: "Tenant", |
8954
|
|
|
reason: "embedded message failed validation", |
8955
|
|
|
cause: err, |
8956
|
|
|
} |
8957
|
|
|
} |
8958
|
|
|
} |
8959
|
|
|
|
8960
|
|
|
if len(errors) > 0 { |
8961
|
|
|
return TenantDeleteResponseMultiError(errors) |
8962
|
|
|
} |
8963
|
|
|
|
8964
|
|
|
return nil |
8965
|
|
|
} |
8966
|
|
|
|
8967
|
|
|
// TenantDeleteResponseMultiError is an error wrapping multiple validation |
8968
|
|
|
// errors returned by TenantDeleteResponse.ValidateAll() if the designated |
8969
|
|
|
// constraints aren't met. |
8970
|
|
|
type TenantDeleteResponseMultiError []error |
8971
|
|
|
|
8972
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
8973
|
|
|
func (m TenantDeleteResponseMultiError) Error() string { |
8974
|
|
|
var msgs []string |
8975
|
|
|
for _, err := range m { |
8976
|
|
|
msgs = append(msgs, err.Error()) |
8977
|
|
|
} |
8978
|
|
|
return strings.Join(msgs, "; ") |
8979
|
|
|
} |
8980
|
|
|
|
8981
|
|
|
// AllErrors returns a list of validation violation errors. |
8982
|
|
|
func (m TenantDeleteResponseMultiError) AllErrors() []error { return m } |
8983
|
|
|
|
8984
|
|
|
// TenantDeleteResponseValidationError is the validation error returned by |
8985
|
|
|
// TenantDeleteResponse.Validate if the designated constraints aren't met. |
8986
|
|
|
type TenantDeleteResponseValidationError struct { |
8987
|
|
|
field string |
8988
|
|
|
reason string |
8989
|
|
|
cause error |
8990
|
|
|
key bool |
8991
|
|
|
} |
8992
|
|
|
|
8993
|
|
|
// Field function returns field value. |
8994
|
|
|
func (e TenantDeleteResponseValidationError) Field() string { return e.field } |
8995
|
|
|
|
8996
|
|
|
// Reason function returns reason value. |
8997
|
|
|
func (e TenantDeleteResponseValidationError) Reason() string { return e.reason } |
8998
|
|
|
|
8999
|
|
|
// Cause function returns cause value. |
9000
|
|
|
func (e TenantDeleteResponseValidationError) Cause() error { return e.cause } |
9001
|
|
|
|
9002
|
|
|
// Key function returns key value. |
9003
|
|
|
func (e TenantDeleteResponseValidationError) Key() bool { return e.key } |
9004
|
|
|
|
9005
|
|
|
// ErrorName returns error name. |
9006
|
|
|
func (e TenantDeleteResponseValidationError) ErrorName() string { |
9007
|
|
|
return "TenantDeleteResponseValidationError" |
9008
|
|
|
} |
9009
|
|
|
|
9010
|
|
|
// Error satisfies the builtin error interface |
9011
|
|
|
func (e TenantDeleteResponseValidationError) Error() string { |
9012
|
|
|
cause := "" |
9013
|
|
|
if e.cause != nil { |
9014
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9015
|
|
|
} |
9016
|
|
|
|
9017
|
|
|
key := "" |
9018
|
|
|
if e.key { |
9019
|
|
|
key = "key for " |
9020
|
|
|
} |
9021
|
|
|
|
9022
|
|
|
return fmt.Sprintf( |
9023
|
|
|
"invalid %sTenantDeleteResponse.%s: %s%s", |
9024
|
|
|
key, |
9025
|
|
|
e.field, |
9026
|
|
|
e.reason, |
9027
|
|
|
cause) |
9028
|
|
|
} |
9029
|
|
|
|
9030
|
|
|
var _ error = TenantDeleteResponseValidationError{} |
9031
|
|
|
|
9032
|
|
|
var _ interface { |
9033
|
|
|
Field() string |
9034
|
|
|
Reason() string |
9035
|
|
|
Key() bool |
9036
|
|
|
Cause() error |
9037
|
|
|
ErrorName() string |
9038
|
|
|
} = TenantDeleteResponseValidationError{} |
9039
|
|
|
|
9040
|
|
|
// Validate checks the field values on TenantListRequest with the rules defined |
9041
|
|
|
// in the proto definition for this message. If any rules are violated, the |
9042
|
|
|
// first error encountered is returned, or nil if there are no violations. |
9043
|
|
|
func (m *TenantListRequest) Validate() error { |
9044
|
|
|
return m.validate(false) |
9045
|
|
|
} |
9046
|
|
|
|
9047
|
|
|
// ValidateAll checks the field values on TenantListRequest with the rules |
9048
|
|
|
// defined in the proto definition for this message. If any rules are |
9049
|
|
|
// violated, the result is a list of violation errors wrapped in |
9050
|
|
|
// TenantListRequestMultiError, or nil if none found. |
9051
|
|
|
func (m *TenantListRequest) ValidateAll() error { |
9052
|
|
|
return m.validate(true) |
9053
|
|
|
} |
9054
|
|
|
|
9055
|
|
|
func (m *TenantListRequest) validate(all bool) error { |
9056
|
|
|
if m == nil { |
9057
|
|
|
return nil |
9058
|
|
|
} |
9059
|
|
|
|
9060
|
|
|
var errors []error |
9061
|
|
|
|
9062
|
|
|
if m.GetPageSize() != 0 { |
9063
|
|
|
|
9064
|
|
|
if m.GetPageSize() < 1 { |
9065
|
|
|
err := TenantListRequestValidationError{ |
9066
|
|
|
field: "PageSize", |
9067
|
|
|
reason: "value must be greater than or equal to 1", |
9068
|
|
|
} |
9069
|
|
|
if !all { |
9070
|
|
|
return err |
9071
|
|
|
} |
9072
|
|
|
errors = append(errors, err) |
9073
|
|
|
} |
9074
|
|
|
|
9075
|
|
|
} |
9076
|
|
|
|
9077
|
|
|
if m.GetContinuousToken() != "" { |
9078
|
|
|
|
9079
|
|
|
} |
9080
|
|
|
|
9081
|
|
|
if len(errors) > 0 { |
9082
|
|
|
return TenantListRequestMultiError(errors) |
9083
|
|
|
} |
9084
|
|
|
|
9085
|
|
|
return nil |
9086
|
|
|
} |
9087
|
|
|
|
9088
|
|
|
// TenantListRequestMultiError is an error wrapping multiple validation errors |
9089
|
|
|
// returned by TenantListRequest.ValidateAll() if the designated constraints |
9090
|
|
|
// aren't met. |
9091
|
|
|
type TenantListRequestMultiError []error |
9092
|
|
|
|
9093
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9094
|
|
|
func (m TenantListRequestMultiError) Error() string { |
9095
|
|
|
var msgs []string |
9096
|
|
|
for _, err := range m { |
9097
|
|
|
msgs = append(msgs, err.Error()) |
9098
|
|
|
} |
9099
|
|
|
return strings.Join(msgs, "; ") |
9100
|
|
|
} |
9101
|
|
|
|
9102
|
|
|
// AllErrors returns a list of validation violation errors. |
9103
|
|
|
func (m TenantListRequestMultiError) AllErrors() []error { return m } |
9104
|
|
|
|
9105
|
|
|
// TenantListRequestValidationError is the validation error returned by |
9106
|
|
|
// TenantListRequest.Validate if the designated constraints aren't met. |
9107
|
|
|
type TenantListRequestValidationError struct { |
9108
|
|
|
field string |
9109
|
|
|
reason string |
9110
|
|
|
cause error |
9111
|
|
|
key bool |
9112
|
|
|
} |
9113
|
|
|
|
9114
|
|
|
// Field function returns field value. |
9115
|
|
|
func (e TenantListRequestValidationError) Field() string { return e.field } |
9116
|
|
|
|
9117
|
|
|
// Reason function returns reason value. |
9118
|
|
|
func (e TenantListRequestValidationError) Reason() string { return e.reason } |
9119
|
|
|
|
9120
|
|
|
// Cause function returns cause value. |
9121
|
|
|
func (e TenantListRequestValidationError) Cause() error { return e.cause } |
9122
|
|
|
|
9123
|
|
|
// Key function returns key value. |
9124
|
|
|
func (e TenantListRequestValidationError) Key() bool { return e.key } |
9125
|
|
|
|
9126
|
|
|
// ErrorName returns error name. |
9127
|
|
|
func (e TenantListRequestValidationError) ErrorName() string { |
9128
|
|
|
return "TenantListRequestValidationError" |
9129
|
|
|
} |
9130
|
|
|
|
9131
|
|
|
// Error satisfies the builtin error interface |
9132
|
|
|
func (e TenantListRequestValidationError) Error() string { |
9133
|
|
|
cause := "" |
9134
|
|
|
if e.cause != nil { |
9135
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9136
|
|
|
} |
9137
|
|
|
|
9138
|
|
|
key := "" |
9139
|
|
|
if e.key { |
9140
|
|
|
key = "key for " |
9141
|
|
|
} |
9142
|
|
|
|
9143
|
|
|
return fmt.Sprintf( |
9144
|
|
|
"invalid %sTenantListRequest.%s: %s%s", |
9145
|
|
|
key, |
9146
|
|
|
e.field, |
9147
|
|
|
e.reason, |
9148
|
|
|
cause) |
9149
|
|
|
} |
9150
|
|
|
|
9151
|
|
|
var _ error = TenantListRequestValidationError{} |
9152
|
|
|
|
9153
|
|
|
var _ interface { |
9154
|
|
|
Field() string |
9155
|
|
|
Reason() string |
9156
|
|
|
Key() bool |
9157
|
|
|
Cause() error |
9158
|
|
|
ErrorName() string |
9159
|
|
|
} = TenantListRequestValidationError{} |
9160
|
|
|
|
9161
|
|
|
// Validate checks the field values on TenantListResponse with the rules |
9162
|
|
|
// defined in the proto definition for this message. If any rules are |
9163
|
|
|
// violated, the first error encountered is returned, or nil if there are no violations. |
9164
|
|
|
func (m *TenantListResponse) Validate() error { |
9165
|
|
|
return m.validate(false) |
9166
|
|
|
} |
9167
|
|
|
|
9168
|
|
|
// ValidateAll checks the field values on TenantListResponse with the rules |
9169
|
|
|
// defined in the proto definition for this message. If any rules are |
9170
|
|
|
// violated, the result is a list of violation errors wrapped in |
9171
|
|
|
// TenantListResponseMultiError, or nil if none found. |
9172
|
|
|
func (m *TenantListResponse) ValidateAll() error { |
9173
|
|
|
return m.validate(true) |
9174
|
|
|
} |
9175
|
|
|
|
9176
|
|
|
func (m *TenantListResponse) validate(all bool) error { |
9177
|
|
|
if m == nil { |
9178
|
|
|
return nil |
9179
|
|
|
} |
9180
|
|
|
|
9181
|
|
|
var errors []error |
9182
|
|
|
|
9183
|
|
|
for idx, item := range m.GetTenants() { |
9184
|
|
|
_, _ = idx, item |
9185
|
|
|
|
9186
|
|
|
if all { |
9187
|
|
|
switch v := interface{}(item).(type) { |
9188
|
|
|
case interface{ ValidateAll() error }: |
9189
|
|
|
if err := v.ValidateAll(); err != nil { |
9190
|
|
|
errors = append(errors, TenantListResponseValidationError{ |
9191
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9192
|
|
|
reason: "embedded message failed validation", |
9193
|
|
|
cause: err, |
9194
|
|
|
}) |
9195
|
|
|
} |
9196
|
|
|
case interface{ Validate() error }: |
9197
|
|
|
if err := v.Validate(); err != nil { |
9198
|
|
|
errors = append(errors, TenantListResponseValidationError{ |
9199
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9200
|
|
|
reason: "embedded message failed validation", |
9201
|
|
|
cause: err, |
9202
|
|
|
}) |
9203
|
|
|
} |
9204
|
|
|
} |
9205
|
|
|
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok { |
9206
|
|
|
if err := v.Validate(); err != nil { |
9207
|
|
|
return TenantListResponseValidationError{ |
9208
|
|
|
field: fmt.Sprintf("Tenants[%v]", idx), |
9209
|
|
|
reason: "embedded message failed validation", |
9210
|
|
|
cause: err, |
9211
|
|
|
} |
9212
|
|
|
} |
9213
|
|
|
} |
9214
|
|
|
|
9215
|
|
|
} |
9216
|
|
|
|
9217
|
|
|
// no validation rules for ContinuousToken |
9218
|
|
|
|
9219
|
|
|
if len(errors) > 0 { |
9220
|
|
|
return TenantListResponseMultiError(errors) |
9221
|
|
|
} |
9222
|
|
|
|
9223
|
|
|
return nil |
9224
|
|
|
} |
9225
|
|
|
|
9226
|
|
|
// TenantListResponseMultiError is an error wrapping multiple validation errors |
9227
|
|
|
// returned by TenantListResponse.ValidateAll() if the designated constraints |
9228
|
|
|
// aren't met. |
9229
|
|
|
type TenantListResponseMultiError []error |
9230
|
|
|
|
9231
|
|
|
// Error returns a concatenation of all the error messages it wraps. |
9232
|
|
|
func (m TenantListResponseMultiError) Error() string { |
9233
|
|
|
var msgs []string |
9234
|
|
|
for _, err := range m { |
9235
|
|
|
msgs = append(msgs, err.Error()) |
9236
|
|
|
} |
9237
|
|
|
return strings.Join(msgs, "; ") |
9238
|
|
|
} |
9239
|
|
|
|
9240
|
|
|
// AllErrors returns a list of validation violation errors. |
9241
|
|
|
func (m TenantListResponseMultiError) AllErrors() []error { return m } |
9242
|
|
|
|
9243
|
|
|
// TenantListResponseValidationError is the validation error returned by |
9244
|
|
|
// TenantListResponse.Validate if the designated constraints aren't met. |
9245
|
|
|
type TenantListResponseValidationError struct { |
9246
|
|
|
field string |
9247
|
|
|
reason string |
9248
|
|
|
cause error |
9249
|
|
|
key bool |
9250
|
|
|
} |
9251
|
|
|
|
9252
|
|
|
// Field function returns field value. |
9253
|
|
|
func (e TenantListResponseValidationError) Field() string { return e.field } |
9254
|
|
|
|
9255
|
|
|
// Reason function returns reason value. |
9256
|
|
|
func (e TenantListResponseValidationError) Reason() string { return e.reason } |
9257
|
|
|
|
9258
|
|
|
// Cause function returns cause value. |
9259
|
|
|
func (e TenantListResponseValidationError) Cause() error { return e.cause } |
9260
|
|
|
|
9261
|
|
|
// Key function returns key value. |
9262
|
|
|
func (e TenantListResponseValidationError) Key() bool { return e.key } |
9263
|
|
|
|
9264
|
|
|
// ErrorName returns error name. |
9265
|
|
|
func (e TenantListResponseValidationError) ErrorName() string { |
9266
|
|
|
return "TenantListResponseValidationError" |
9267
|
|
|
} |
9268
|
|
|
|
9269
|
|
|
// Error satisfies the builtin error interface |
9270
|
|
|
func (e TenantListResponseValidationError) Error() string { |
9271
|
|
|
cause := "" |
9272
|
|
|
if e.cause != nil { |
9273
|
|
|
cause = fmt.Sprintf(" | caused by: %v", e.cause) |
9274
|
|
|
} |
9275
|
|
|
|
9276
|
|
|
key := "" |
9277
|
|
|
if e.key { |
9278
|
|
|
key = "key for " |
9279
|
|
|
} |
9280
|
|
|
|
9281
|
|
|
return fmt.Sprintf( |
9282
|
|
|
"invalid %sTenantListResponse.%s: %s%s", |
9283
|
|
|
key, |
9284
|
|
|
e.field, |
9285
|
|
|
e.reason, |
9286
|
|
|
cause) |
9287
|
|
|
} |
9288
|
|
|
|
9289
|
|
|
var _ error = TenantListResponseValidationError{} |
9290
|
|
|
|
9291
|
|
|
var _ interface { |
9292
|
|
|
Field() string |
9293
|
|
|
Reason() string |
9294
|
|
|
Key() bool |
9295
|
|
|
Cause() error |
9296
|
|
|
ErrorName() string |
9297
|
|
|
} = TenantListResponseValidationError{} |
9298
|
|
|
|