Debian Codegraph @

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

raw symbols SCIP
1 // Code generated by protoc-gen-validate. DO NOT EDIT.
2 // source: xds/annotations/v3/migrate.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 MigrateAnnotation with the rules defined
39 // in the proto definition for this message. If any rules are violated, the
40 // first error encountered is returned, or nil if there are no violations.
41 func (m *MigrateAnnotation) Validate() error {
42 return m.validate(false)
43 }
44
45 // ValidateAll checks the field values on MigrateAnnotation 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 // MigrateAnnotationMultiError, or nil if none found.
49 func (m *MigrateAnnotation) ValidateAll() error {
50 return m.validate(true)
51 }
52
53 func (m *MigrateAnnotation) validate(all bool) error {
54 if m == nil {
55 return nil
56 }
57
58 var errors []error
59
60 // no validation rules for Rename
61
62 if len(errors) > 0 {
63 return MigrateAnnotationMultiError(errors)
64 }
65
66 return nil
67 }
68
69 // MigrateAnnotationMultiError is an error wrapping multiple validation errors
70 // returned by MigrateAnnotation.ValidateAll() if the designated constraints
71 // aren't met.
72 type MigrateAnnotationMultiError []error
73
74 // Error returns a concatenation of all the error messages it wraps.
75 func (m MigrateAnnotationMultiError) 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 MigrateAnnotationMultiError) AllErrors() []error { return m }
85
86 // MigrateAnnotationValidationError is the validation error returned by
87 // MigrateAnnotation.Validate if the designated constraints aren't met.
88 type MigrateAnnotationValidationError struct {
89 field string
90 reason string
91 cause error
92 key bool
93 }
94
95 // Field function returns field value.
96 func (e MigrateAnnotationValidationError) Field() string { return e.field }
97
98 // Reason function returns reason value.
99 func (e MigrateAnnotationValidationError) Reason() string { return e.reason }
100
101 // Cause function returns cause value.
102 func (e MigrateAnnotationValidationError) Cause() error { return e.cause }
103
104 // Key function returns key value.
105 func (e MigrateAnnotationValidationError) Key() bool { return e.key }
106
107 // ErrorName returns error name.
108 func (e MigrateAnnotationValidationError) ErrorName() string {
109 return "MigrateAnnotationValidationError"
110 }
111
112 // Error satisfies the builtin error interface
113 func (e MigrateAnnotationValidationError) 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 %sMigrateAnnotation.%s: %s%s",
126 key,
127 e.field,
128 e.reason,
129 cause)
130 }
131
132 var _ error = MigrateAnnotationValidationError{}
133
134 var _ interface {
135 Field() string
136 Reason() string
137 Key() bool
138 Cause() error
139 ErrorName() string
140 } = MigrateAnnotationValidationError{}
141
142 // Validate checks the field values on FieldMigrateAnnotation 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 *FieldMigrateAnnotation) Validate() error {
146 return m.validate(false)
147 }
148
149 // ValidateAll checks the field values on FieldMigrateAnnotation with the rules
150 // 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 // FieldMigrateAnnotationMultiError, or nil if none found.
153 func (m *FieldMigrateAnnotation) ValidateAll() error {
154 return m.validate(true)
155 }
156
157 func (m *FieldMigrateAnnotation) validate(all bool) error {
158 if m == nil {
159 return nil
160 }
161
162 var errors []error
163
164 // no validation rules for Rename
165
166 // no validation rules for OneofPromotion
167
168 if len(errors) > 0 {
169 return FieldMigrateAnnotationMultiError(errors)
170 }
171
172 return nil
173 }
174
175 // FieldMigrateAnnotationMultiError is an error wrapping multiple validation
176 // errors returned by FieldMigrateAnnotation.ValidateAll() if the designated
177 // constraints aren't met.
178 type FieldMigrateAnnotationMultiError []error
179
180 // Error returns a concatenation of all the error messages it wraps.
181 func (m FieldMigrateAnnotationMultiError) Error() string {
182 msgs := make([]string, 0, len(m))
183 for _, err := range m {
184 msgs = append(msgs, err.Error())
185 }
186 return strings.Join(msgs, "; ")
187 }
188
189 // AllErrors returns a list of validation violation errors.
190 func (m FieldMigrateAnnotationMultiError) AllErrors() []error { return m }
191
192 // FieldMigrateAnnotationValidationError is the validation error returned by
193 // FieldMigrateAnnotation.Validate if the designated constraints aren't met.
194 type FieldMigrateAnnotationValidationError struct {
195 field string
196 reason string
197 cause error
198 key bool
199 }
200
201 // Field function returns field value.
202 func (e FieldMigrateAnnotationValidationError) Field() string { return e.field }
203
204 // Reason function returns reason value.
205 func (e FieldMigrateAnnotationValidationError) Reason() string { return e.reason }
206
207 // Cause function returns cause value.
208 func (e FieldMigrateAnnotationValidationError) Cause() error { return e.cause }
209
210 // Key function returns key value.
211 func (e FieldMigrateAnnotationValidationError) Key() bool { return e.key }
212
213 // ErrorName returns error name.
214 func (e FieldMigrateAnnotationValidationError) ErrorName() string {
215 return "FieldMigrateAnnotationValidationError"
216 }
217
218 // Error satisfies the builtin error interface
219 func (e FieldMigrateAnnotationValidationError) Error() string {
220 cause := ""
221 if e.cause != nil {
222 cause = fmt.Sprintf(" | caused by: %v", e.cause)
223 }
224
225 key := ""
226 if e.key {
227 key = "key for "
228 }
229
230 return fmt.Sprintf(
231 "invalid %sFieldMigrateAnnotation.%s: %s%s",
232 key,
233 e.field,
234 e.reason,
235 cause)
236 }
237
238 var _ error = FieldMigrateAnnotationValidationError{}
239
240 var _ interface {
241 Field() string
242 Reason() string
243 Key() bool
244 Cause() error
245 ErrorName() string
246 } = FieldMigrateAnnotationValidationError{}
247
248 // Validate checks the field values on FileMigrateAnnotation with the rules
249 // defined in the proto definition for this message. If any rules are
250 // violated, the first error encountered is returned, or nil if there are no violations.
251 func (m *FileMigrateAnnotation) Validate() error {
252 return m.validate(false)
253 }
254
255 // ValidateAll checks the field values on FileMigrateAnnotation with the rules
256 // defined in the proto definition for this message. If any rules are
257 // violated, the result is a list of violation errors wrapped in
258 // FileMigrateAnnotationMultiError, or nil if none found.
259 func (m *FileMigrateAnnotation) ValidateAll() error {
260 return m.validate(true)
261 }
262
263 func (m *FileMigrateAnnotation) validate(all bool) error {
264 if m == nil {
265 return nil
266 }
267
268 var errors []error
269
270 // no validation rules for MoveToPackage
271
272 if len(errors) > 0 {
273 return FileMigrateAnnotationMultiError(errors)
274 }
275
276 return nil
277 }
278
279 // FileMigrateAnnotationMultiError is an error wrapping multiple validation
280 // errors returned by FileMigrateAnnotation.ValidateAll() if the designated
281 // constraints aren't met.
282 type FileMigrateAnnotationMultiError []error
283
284 // Error returns a concatenation of all the error messages it wraps.
285 func (m FileMigrateAnnotationMultiError) Error() string {
286 msgs := make([]string, 0, len(m))
287 for _, err := range m {
288 msgs = append(msgs, err.Error())
289 }
290 return strings.Join(msgs, "; ")
291 }
292
293 // AllErrors returns a list of validation violation errors.
294 func (m FileMigrateAnnotationMultiError) AllErrors() []error { return m }
295
296 // FileMigrateAnnotationValidationError is the validation error returned by
297 // FileMigrateAnnotation.Validate if the designated constraints aren't met.
298 type FileMigrateAnnotationValidationError struct {
299 field string
300 reason string
301 cause error
302 key bool
303 }
304
305 // Field function returns field value.
306 func (e FileMigrateAnnotationValidationError) Field() string { return e.field }
307
308 // Reason function returns reason value.
309 func (e FileMigrateAnnotationValidationError) Reason() string { return e.reason }
310
311 // Cause function returns cause value.
312 func (e FileMigrateAnnotationValidationError) Cause() error { return e.cause }
313
314 // Key function returns key value.
315 func (e FileMigrateAnnotationValidationError) Key() bool { return e.key }
316
317 // ErrorName returns error name.
318 func (e FileMigrateAnnotationValidationError) ErrorName() string {
319 return "FileMigrateAnnotationValidationError"
320 }
321
322 // Error satisfies the builtin error interface
323 func (e FileMigrateAnnotationValidationError) Error() string {
324 cause := ""
325 if e.cause != nil {
326 cause = fmt.Sprintf(" | caused by: %v", e.cause)
327 }
328
329 key := ""
330 if e.key {
331 key = "key for "
332 }
333
334 return fmt.Sprintf(
335 "invalid %sFileMigrateAnnotation.%s: %s%s",
336 key,
337 e.field,
338 e.reason,
339 cause)
340 }
341
342 var _ error = FileMigrateAnnotationValidationError{}
343
344 var _ interface {
345 Field() string
346 Reason() string
347 Key() bool
348 Cause() error
349 ErrorName() string
350 } = FileMigrateAnnotationValidationError{}