Debian Codegraph @

go/xds/annotations/v3/status.pb.validate.go

raw symbols SCIP
1 // Code generated by protoc-gen-validate. DO NOT EDIT.
2 // source: xds/annotations/v3/status.proto
3
4 package v3
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 FileStatusAnnotation 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 *FileStatusAnnotation) Validate() error {
42 return m.validate(false)
43 }
44
45 // ValidateAll checks the field values on FileStatusAnnotation 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 // FileStatusAnnotationMultiError, or nil if none found.
49 func (m *FileStatusAnnotation) ValidateAll() error {
50 return m.validate(true)
51 }
52
53 func (m *FileStatusAnnotation) validate(all bool) error {
54 if m == nil {
55 return nil
56 }
57
58 var errors []error
59
60 // no validation rules for WorkInProgress
61
62 if len(errors) > 0 {
63 return FileStatusAnnotationMultiError(errors)
64 }
65
66 return nil
67 }
68
69 // FileStatusAnnotationMultiError is an error wrapping multiple validation
70 // errors returned by FileStatusAnnotation.ValidateAll() if the designated
71 // constraints aren't met.
72 type FileStatusAnnotationMultiError []error
73
74 // Error returns a concatenation of all the error messages it wraps.
75 func (m FileStatusAnnotationMultiError) Error() string {
76 msgs := make([]string, 0, len(m))
77 for _, err := range m {
78 msgs = append(msgs, err.Error())
79 }
80 return strings.Join(msgs, "; ")
81 }
82
83 // AllErrors returns a list of validation violation errors.
84 func (m FileStatusAnnotationMultiError) AllErrors() []error { return m }
85
86 // FileStatusAnnotationValidationError is the validation error returned by
87 // FileStatusAnnotation.Validate if the designated constraints aren't met.
88 type FileStatusAnnotationValidationError struct {
89 field string
90 reason string
91 cause error
92 key bool
93 }
94
95 // Field function returns field value.
96 func (e FileStatusAnnotationValidationError) Field() string { return e.field }
97
98 // Reason function returns reason value.
99 func (e FileStatusAnnotationValidationError) Reason() string { return e.reason }
100
101 // Cause function returns cause value.
102 func (e FileStatusAnnotationValidationError) Cause() error { return e.cause }
103
104 // Key function returns key value.
105 func (e FileStatusAnnotationValidationError) Key() bool { return e.key }
106
107 // ErrorName returns error name.
108 func (e FileStatusAnnotationValidationError) ErrorName() string {
109 return "FileStatusAnnotationValidationError"
110 }
111
112 // Error satisfies the builtin error interface
113 func (e FileStatusAnnotationValidationError) Error() string {
114 cause := ""
115 if e.cause != nil {
116 cause = fmt.Sprintf(" | caused by: %v", e.cause)
117 }
118
119 key := ""
120 if e.key {
121 key = "key for "
122 }
123
124 return fmt.Sprintf(
125 "invalid %sFileStatusAnnotation.%s: %s%s",
126 key,
127 e.field,
128 e.reason,
129 cause)
130 }
131
132 var _ error = FileStatusAnnotationValidationError{}
133
134 var _ interface {
135 Field() string
136 Reason() string
137 Key() bool
138 Cause() error
139 ErrorName() string
140 } = FileStatusAnnotationValidationError{}
141
142 // Validate checks the field values on MessageStatusAnnotation with the rules
143 // defined in the proto definition for this message. If any rules are
144 // violated, the first error encountered is returned, or nil if there are no violations.
145 func (m *MessageStatusAnnotation) Validate() error {
146 return m.validate(false)
147 }
148
149 // ValidateAll checks the field values on MessageStatusAnnotation with the
150 // rules defined in the proto definition for this message. If any rules are
151 // violated, the result is a list of violation errors wrapped in
152 // MessageStatusAnnotationMultiError, or nil if none found.
153 func (m *MessageStatusAnnotation) ValidateAll() error {
154 return m.validate(true)
155 }
156
157 func (m *MessageStatusAnnotation) validate(all bool) error {
158 if m == nil {
159 return nil
160 }
161
162 var errors []error
163
164 // no validation rules for WorkInProgress
165
166 if len(errors) > 0 {
167 return MessageStatusAnnotationMultiError(errors)
168 }
169
170 return nil
171 }
172
173 // MessageStatusAnnotationMultiError is an error wrapping multiple validation
174 // errors returned by MessageStatusAnnotation.ValidateAll() if the designated
175 // constraints aren't met.
176 type MessageStatusAnnotationMultiError []error
177
178 // Error returns a concatenation of all the error messages it wraps.
179 func (m MessageStatusAnnotationMultiError) Error() string {
180 msgs := make([]string, 0, len(m))
181 for _, err := range m {
182 msgs = append(msgs, err.Error())
183 }
184 return strings.Join(msgs, "; ")
185 }
186
187 // AllErrors returns a list of validation violation errors.
188 func (m MessageStatusAnnotationMultiError) AllErrors() []error { return m }
189
190 // MessageStatusAnnotationValidationError is the validation error returned by
191 // MessageStatusAnnotation.Validate if the designated constraints aren't met.
192 type MessageStatusAnnotationValidationError struct {
193 field string
194 reason string
195 cause error
196 key bool
197 }
198
199 // Field function returns field value.
200 func (e MessageStatusAnnotationValidationError) Field() string { return e.field }
201
202 // Reason function returns reason value.
203 func (e MessageStatusAnnotationValidationError) Reason() string { return e.reason }
204
205 // Cause function returns cause value.
206 func (e MessageStatusAnnotationValidationError) Cause() error { return e.cause }
207
208 // Key function returns key value.
209 func (e MessageStatusAnnotationValidationError) Key() bool { return e.key }
210
211 // ErrorName returns error name.
212 func (e MessageStatusAnnotationValidationError) ErrorName() string {
213 return "MessageStatusAnnotationValidationError"
214 }
215
216 // Error satisfies the builtin error interface
217 func (e MessageStatusAnnotationValidationError) Error() string {
218 cause := ""
219 if e.cause != nil {
220 cause = fmt.Sprintf(" | caused by: %v", e.cause)
221 }
222
223 key := ""
224 if e.key {
225 key = "key for "
226 }
227
228 return fmt.Sprintf(
229 "invalid %sMessageStatusAnnotation.%s: %s%s",
230 key,
231 e.field,
232 e.reason,
233 cause)
234 }
235
236 var _ error = MessageStatusAnnotationValidationError{}
237
238 var _ interface {
239 Field() string
240 Reason() string
241 Key() bool
242 Cause() error
243 ErrorName() string
244 } = MessageStatusAnnotationValidationError{}
245
246 // Validate checks the field values on FieldStatusAnnotation with the rules
247 // defined in the proto definition for this message. If any rules are
248 // violated, the first error encountered is returned, or nil if there are no violations.
249 func (m *FieldStatusAnnotation) Validate() error {
250 return m.validate(false)
251 }
252
253 // ValidateAll checks the field values on FieldStatusAnnotation with the rules
254 // defined in the proto definition for this message. If any rules are
255 // violated, the result is a list of violation errors wrapped in
256 // FieldStatusAnnotationMultiError, or nil if none found.
257 func (m *FieldStatusAnnotation) ValidateAll() error {
258 return m.validate(true)
259 }
260
261 func (m *FieldStatusAnnotation) validate(all bool) error {
262 if m == nil {
263 return nil
264 }
265
266 var errors []error
267
268 // no validation rules for WorkInProgress
269
270 if len(errors) > 0 {
271 return FieldStatusAnnotationMultiError(errors)
272 }
273
274 return nil
275 }
276
277 // FieldStatusAnnotationMultiError is an error wrapping multiple validation
278 // errors returned by FieldStatusAnnotation.ValidateAll() if the designated
279 // constraints aren't met.
280 type FieldStatusAnnotationMultiError []error
281
282 // Error returns a concatenation of all the error messages it wraps.
283 func (m FieldStatusAnnotationMultiError) Error() string {
284 msgs := make([]string, 0, len(m))
285 for _, err := range m {
286 msgs = append(msgs, err.Error())
287 }
288 return strings.Join(msgs, "; ")
289 }
290
291 // AllErrors returns a list of validation violation errors.
292 func (m FieldStatusAnnotationMultiError) AllErrors() []error { return m }
293
294 // FieldStatusAnnotationValidationError is the validation error returned by
295 // FieldStatusAnnotation.Validate if the designated constraints aren't met.
296 type FieldStatusAnnotationValidationError struct {
297 field string
298 reason string
299 cause error
300 key bool
301 }
302
303 // Field function returns field value.
304 func (e FieldStatusAnnotationValidationError) Field() string { return e.field }
305
306 // Reason function returns reason value.
307 func (e FieldStatusAnnotationValidationError) Reason() string { return e.reason }
308
309 // Cause function returns cause value.
310 func (e FieldStatusAnnotationValidationError) Cause() error { return e.cause }
311
312 // Key function returns key value.
313 func (e FieldStatusAnnotationValidationError) Key() bool { return e.key }
314
315 // ErrorName returns error name.
316 func (e FieldStatusAnnotationValidationError) ErrorName() string {
317 return "FieldStatusAnnotationValidationError"
318 }
319
320 // Error satisfies the builtin error interface
321 func (e FieldStatusAnnotationValidationError) Error() string {
322 cause := ""
323 if e.cause != nil {
324 cause = fmt.Sprintf(" | caused by: %v", e.cause)
325 }
326
327 key := ""
328 if e.key {
329 key = "key for "
330 }
331
332 return fmt.Sprintf(
333 "invalid %sFieldStatusAnnotation.%s: %s%s",
334 key,
335 e.field,
336 e.reason,
337 cause)
338 }
339
340 var _ error = FieldStatusAnnotationValidationError{}
341
342 var _ interface {
343 Field() string
344 Reason() string
345 Key() bool
346 Cause() error
347 ErrorName() string
348 } = FieldStatusAnnotationValidationError{}
349
350 // Validate checks the field values on StatusAnnotation with the rules defined
351 // in the proto definition for this message. If any rules are violated, the
352 // first error encountered is returned, or nil if there are no violations.
353 func (m *StatusAnnotation) Validate() error {
354 return m.validate(false)
355 }
356
357 // ValidateAll checks the field values on StatusAnnotation with the rules
358 // defined in the proto definition for this message. If any rules are
359 // violated, the result is a list of violation errors wrapped in
360 // StatusAnnotationMultiError, or nil if none found.
361 func (m *StatusAnnotation) ValidateAll() error {
362 return m.validate(true)
363 }
364
365 func (m *StatusAnnotation) validate(all bool) error {
366 if m == nil {
367 return nil
368 }
369
370 var errors []error
371
372 // no validation rules for WorkInProgress
373
374 // no validation rules for PackageVersionStatus
375
376 if len(errors) > 0 {
377 return StatusAnnotationMultiError(errors)
378 }
379
380 return nil
381 }
382
383 // StatusAnnotationMultiError is an error wrapping multiple validation errors
384 // returned by StatusAnnotation.ValidateAll() if the designated constraints
385 // aren't met.
386 type StatusAnnotationMultiError []error
387
388 // Error returns a concatenation of all the error messages it wraps.
389 func (m StatusAnnotationMultiError) Error() string {
390 msgs := make([]string, 0, len(m))
391 for _, err := range m {
392 msgs = append(msgs, err.Error())
393 }
394 return strings.Join(msgs, "; ")
395 }
396
397 // AllErrors returns a list of validation violation errors.
398 func (m StatusAnnotationMultiError) AllErrors() []error { return m }
399
400 // StatusAnnotationValidationError is the validation error returned by
401 // StatusAnnotation.Validate if the designated constraints aren't met.
402 type StatusAnnotationValidationError struct {
403 field string
404 reason string
405 cause error
406 key bool
407 }
408
409 // Field function returns field value.
410 func (e StatusAnnotationValidationError) Field() string { return e.field }
411
412 // Reason function returns reason value.
413 func (e StatusAnnotationValidationError) Reason() string { return e.reason }
414
415 // Cause function returns cause value.
416 func (e StatusAnnotationValidationError) Cause() error { return e.cause }
417
418 // Key function returns key value.
419 func (e StatusAnnotationValidationError) Key() bool { return e.key }
420
421 // ErrorName returns error name.
422 func (e StatusAnnotationValidationError) ErrorName() string { return "StatusAnnotationValidationError" }
423
424 // Error satisfies the builtin error interface
425 func (e StatusAnnotationValidationError) Error() string {
426 cause := ""
427 if e.cause != nil {
428 cause = fmt.Sprintf(" | caused by: %v", e.cause)
429 }
430
431 key := ""
432 if e.key {
433 key = "key for "
434 }
435
436 return fmt.Sprintf(
437 "invalid %sStatusAnnotation.%s: %s%s",
438 key,
439 e.field,
440 e.reason,
441 cause)
442 }
443
444 var _ error = StatusAnnotationValidationError{}
445
446 var _ interface {
447 Field() string
448 Reason() string
449 Key() bool
450 Cause() error
451 ErrorName() string
452 } = StatusAnnotationValidationError{}