1
2
3
4 package v2alpha
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
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
39
40
41 func (m *StreamTapsRequest) Validate() error {
42 return m.validate(false)
43 }
44
45
46
47
48
49 func (m *StreamTapsRequest) ValidateAll() error {
50 return m.validate(true)
51 }
52
53 func (m *StreamTapsRequest) validate(all bool) error {
54 if m == nil {
55 return nil
56 }
57
58 var errors []error
59
60 if all {
61 switch v := interface{}(m.GetIdentifier()).(type) {
62 case interface{ ValidateAll() error }:
63 if err := v.ValidateAll(); err != nil {
64 errors = append(errors, StreamTapsRequestValidationError{
65 field: "Identifier",
66 reason: "embedded message failed validation",
67 cause: err,
68 })
69 }
70 case interface{ Validate() error }:
71 if err := v.Validate(); err != nil {
72 errors = append(errors, StreamTapsRequestValidationError{
73 field: "Identifier",
74 reason: "embedded message failed validation",
75 cause: err,
76 })
77 }
78 }
79 } else if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok {
80 if err := v.Validate(); err != nil {
81 return StreamTapsRequestValidationError{
82 field: "Identifier",
83 reason: "embedded message failed validation",
84 cause: err,
85 }
86 }
87 }
88
89
90
91 if all {
92 switch v := interface{}(m.GetTrace()).(type) {
93 case interface{ ValidateAll() error }:
94 if err := v.ValidateAll(); err != nil {
95 errors = append(errors, StreamTapsRequestValidationError{
96 field: "Trace",
97 reason: "embedded message failed validation",
98 cause: err,
99 })
100 }
101 case interface{ Validate() error }:
102 if err := v.Validate(); err != nil {
103 errors = append(errors, StreamTapsRequestValidationError{
104 field: "Trace",
105 reason: "embedded message failed validation",
106 cause: err,
107 })
108 }
109 }
110 } else if v, ok := interface{}(m.GetTrace()).(interface{ Validate() error }); ok {
111 if err := v.Validate(); err != nil {
112 return StreamTapsRequestValidationError{
113 field: "Trace",
114 reason: "embedded message failed validation",
115 cause: err,
116 }
117 }
118 }
119
120 if len(errors) > 0 {
121 return StreamTapsRequestMultiError(errors)
122 }
123
124 return nil
125 }
126
127
128
129
130 type StreamTapsRequestMultiError []error
131
132
133 func (m StreamTapsRequestMultiError) Error() string {
134 var msgs []string
135 for _, err := range m {
136 msgs = append(msgs, err.Error())
137 }
138 return strings.Join(msgs, "; ")
139 }
140
141
142 func (m StreamTapsRequestMultiError) AllErrors() []error { return m }
143
144
145
146 type StreamTapsRequestValidationError struct {
147 field string
148 reason string
149 cause error
150 key bool
151 }
152
153
154 func (e StreamTapsRequestValidationError) Field() string { return e.field }
155
156
157 func (e StreamTapsRequestValidationError) Reason() string { return e.reason }
158
159
160 func (e StreamTapsRequestValidationError) Cause() error { return e.cause }
161
162
163 func (e StreamTapsRequestValidationError) Key() bool { return e.key }
164
165
166 func (e StreamTapsRequestValidationError) ErrorName() string {
167 return "StreamTapsRequestValidationError"
168 }
169
170
171 func (e StreamTapsRequestValidationError) Error() string {
172 cause := ""
173 if e.cause != nil {
174 cause = fmt.Sprintf(" | caused by: %v", e.cause)
175 }
176
177 key := ""
178 if e.key {
179 key = "key for "
180 }
181
182 return fmt.Sprintf(
183 "invalid %sStreamTapsRequest.%s: %s%s",
184 key,
185 e.field,
186 e.reason,
187 cause)
188 }
189
190 var _ error = StreamTapsRequestValidationError{}
191
192 var _ interface {
193 Field() string
194 Reason() string
195 Key() bool
196 Cause() error
197 ErrorName() string
198 } = StreamTapsRequestValidationError{}
199
200
201
202
203 func (m *StreamTapsResponse) Validate() error {
204 return m.validate(false)
205 }
206
207
208
209
210
211 func (m *StreamTapsResponse) ValidateAll() error {
212 return m.validate(true)
213 }
214
215 func (m *StreamTapsResponse) validate(all bool) error {
216 if m == nil {
217 return nil
218 }
219
220 var errors []error
221
222 if len(errors) > 0 {
223 return StreamTapsResponseMultiError(errors)
224 }
225
226 return nil
227 }
228
229
230
231
232 type StreamTapsResponseMultiError []error
233
234
235 func (m StreamTapsResponseMultiError) Error() string {
236 var msgs []string
237 for _, err := range m {
238 msgs = append(msgs, err.Error())
239 }
240 return strings.Join(msgs, "; ")
241 }
242
243
244 func (m StreamTapsResponseMultiError) AllErrors() []error { return m }
245
246
247
248 type StreamTapsResponseValidationError struct {
249 field string
250 reason string
251 cause error
252 key bool
253 }
254
255
256 func (e StreamTapsResponseValidationError) Field() string { return e.field }
257
258
259 func (e StreamTapsResponseValidationError) Reason() string { return e.reason }
260
261
262 func (e StreamTapsResponseValidationError) Cause() error { return e.cause }
263
264
265 func (e StreamTapsResponseValidationError) Key() bool { return e.key }
266
267
268 func (e StreamTapsResponseValidationError) ErrorName() string {
269 return "StreamTapsResponseValidationError"
270 }
271
272
273 func (e StreamTapsResponseValidationError) Error() string {
274 cause := ""
275 if e.cause != nil {
276 cause = fmt.Sprintf(" | caused by: %v", e.cause)
277 }
278
279 key := ""
280 if e.key {
281 key = "key for "
282 }
283
284 return fmt.Sprintf(
285 "invalid %sStreamTapsResponse.%s: %s%s",
286 key,
287 e.field,
288 e.reason,
289 cause)
290 }
291
292 var _ error = StreamTapsResponseValidationError{}
293
294 var _ interface {
295 Field() string
296 Reason() string
297 Key() bool
298 Cause() error
299 ErrorName() string
300 } = StreamTapsResponseValidationError{}
301
302
303
304
305 func (m *StreamTapsRequest_Identifier) Validate() error {
306 return m.validate(false)
307 }
308
309
310
311
312
313 func (m *StreamTapsRequest_Identifier) ValidateAll() error {
314 return m.validate(true)
315 }
316
317 func (m *StreamTapsRequest_Identifier) validate(all bool) error {
318 if m == nil {
319 return nil
320 }
321
322 var errors []error
323
324 if m.GetNode() == nil {
325 err := StreamTapsRequest_IdentifierValidationError{
326 field: "Node",
327 reason: "value is required",
328 }
329 if !all {
330 return err
331 }
332 errors = append(errors, err)
333 }
334
335 if all {
336 switch v := interface{}(m.GetNode()).(type) {
337 case interface{ ValidateAll() error }:
338 if err := v.ValidateAll(); err != nil {
339 errors = append(errors, StreamTapsRequest_IdentifierValidationError{
340 field: "Node",
341 reason: "embedded message failed validation",
342 cause: err,
343 })
344 }
345 case interface{ Validate() error }:
346 if err := v.Validate(); err != nil {
347 errors = append(errors, StreamTapsRequest_IdentifierValidationError{
348 field: "Node",
349 reason: "embedded message failed validation",
350 cause: err,
351 })
352 }
353 }
354 } else if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
355 if err := v.Validate(); err != nil {
356 return StreamTapsRequest_IdentifierValidationError{
357 field: "Node",
358 reason: "embedded message failed validation",
359 cause: err,
360 }
361 }
362 }
363
364
365
366 if len(errors) > 0 {
367 return StreamTapsRequest_IdentifierMultiError(errors)
368 }
369
370 return nil
371 }
372
373
374
375
376 type StreamTapsRequest_IdentifierMultiError []error
377
378
379 func (m StreamTapsRequest_IdentifierMultiError) Error() string {
380 var msgs []string
381 for _, err := range m {
382 msgs = append(msgs, err.Error())
383 }
384 return strings.Join(msgs, "; ")
385 }
386
387
388 func (m StreamTapsRequest_IdentifierMultiError) AllErrors() []error { return m }
389
390
391
392
393 type StreamTapsRequest_IdentifierValidationError struct {
394 field string
395 reason string
396 cause error
397 key bool
398 }
399
400
401 func (e StreamTapsRequest_IdentifierValidationError) Field() string { return e.field }
402
403
404 func (e StreamTapsRequest_IdentifierValidationError) Reason() string { return e.reason }
405
406
407 func (e StreamTapsRequest_IdentifierValidationError) Cause() error { return e.cause }
408
409
410 func (e StreamTapsRequest_IdentifierValidationError) Key() bool { return e.key }
411
412
413 func (e StreamTapsRequest_IdentifierValidationError) ErrorName() string {
414 return "StreamTapsRequest_IdentifierValidationError"
415 }
416
417
418 func (e StreamTapsRequest_IdentifierValidationError) Error() string {
419 cause := ""
420 if e.cause != nil {
421 cause = fmt.Sprintf(" | caused by: %v", e.cause)
422 }
423
424 key := ""
425 if e.key {
426 key = "key for "
427 }
428
429 return fmt.Sprintf(
430 "invalid %sStreamTapsRequest_Identifier.%s: %s%s",
431 key,
432 e.field,
433 e.reason,
434 cause)
435 }
436
437 var _ error = StreamTapsRequest_IdentifierValidationError{}
438
439 var _ interface {
440 Field() string
441 Reason() string
442 Key() bool
443 Cause() error
444 ErrorName() string
445 } = StreamTapsRequest_IdentifierValidationError{}
446
View as plain text