-
Notifications
You must be signed in to change notification settings - Fork 0
/
logistic_parcel_api.pb.validate.go
861 lines (698 loc) · 20.8 KB
/
logistic_parcel_api.pb.validate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: gempellm/logistic_parcel_api/v1/logistic_parcel_api.proto
package logistic_parcel_api
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
)
// Validate checks the field values on Parcel with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *Parcel) Validate() error {
if m == nil {
return nil
}
// no validation rules for Id
// no validation rules for Name
if v, ok := interface{}(m.GetCreated()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ParcelValidationError{
field: "Created",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// ParcelValidationError is the validation error returned by Parcel.Validate if
// the designated constraints aren't met.
type ParcelValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ParcelValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ParcelValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ParcelValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ParcelValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ParcelValidationError) ErrorName() string { return "ParcelValidationError" }
// Error satisfies the builtin error interface
func (e ParcelValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sParcel.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ParcelValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ParcelValidationError{}
// Validate checks the field values on DescribeParcelV1Request with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DescribeParcelV1Request) Validate() error {
if m == nil {
return nil
}
if m.GetParcelId() <= 0 {
return DescribeParcelV1RequestValidationError{
field: "ParcelId",
reason: "value must be greater than 0",
}
}
return nil
}
// DescribeParcelV1RequestValidationError is the validation error returned by
// DescribeParcelV1Request.Validate if the designated constraints aren't met.
type DescribeParcelV1RequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DescribeParcelV1RequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DescribeParcelV1RequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DescribeParcelV1RequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DescribeParcelV1RequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DescribeParcelV1RequestValidationError) ErrorName() string {
return "DescribeParcelV1RequestValidationError"
}
// Error satisfies the builtin error interface
func (e DescribeParcelV1RequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDescribeParcelV1Request.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DescribeParcelV1RequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DescribeParcelV1RequestValidationError{}
// Validate checks the field values on DescribeParcelV1Response with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DescribeParcelV1Response) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DescribeParcelV1ResponseValidationError{
field: "Value",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// DescribeParcelV1ResponseValidationError is the validation error returned by
// DescribeParcelV1Response.Validate if the designated constraints aren't met.
type DescribeParcelV1ResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DescribeParcelV1ResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DescribeParcelV1ResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DescribeParcelV1ResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DescribeParcelV1ResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DescribeParcelV1ResponseValidationError) ErrorName() string {
return "DescribeParcelV1ResponseValidationError"
}
// Error satisfies the builtin error interface
func (e DescribeParcelV1ResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDescribeParcelV1Response.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DescribeParcelV1ResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DescribeParcelV1ResponseValidationError{}
// Validate checks the field values on CreateParcelRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *CreateParcelRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for Name
return nil
}
// CreateParcelRequestValidationError is the validation error returned by
// CreateParcelRequest.Validate if the designated constraints aren't met.
type CreateParcelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateParcelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateParcelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateParcelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateParcelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateParcelRequestValidationError) ErrorName() string {
return "CreateParcelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e CreateParcelRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateParcelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateParcelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateParcelRequestValidationError{}
// Validate checks the field values on CreateParcelResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *CreateParcelResponse) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CreateParcelResponseValidationError{
field: "Value",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// CreateParcelResponseValidationError is the validation error returned by
// CreateParcelResponse.Validate if the designated constraints aren't met.
type CreateParcelResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateParcelResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateParcelResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateParcelResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateParcelResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateParcelResponseValidationError) ErrorName() string {
return "CreateParcelResponseValidationError"
}
// Error satisfies the builtin error interface
func (e CreateParcelResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateParcelResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateParcelResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateParcelResponseValidationError{}
// Validate checks the field values on DescribeParcelRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DescribeParcelRequest) Validate() error {
if m == nil {
return nil
}
if m.GetParcelId() <= 0 {
return DescribeParcelRequestValidationError{
field: "ParcelId",
reason: "value must be greater than 0",
}
}
return nil
}
// DescribeParcelRequestValidationError is the validation error returned by
// DescribeParcelRequest.Validate if the designated constraints aren't met.
type DescribeParcelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DescribeParcelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DescribeParcelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DescribeParcelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DescribeParcelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DescribeParcelRequestValidationError) ErrorName() string {
return "DescribeParcelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e DescribeParcelRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDescribeParcelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DescribeParcelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DescribeParcelRequestValidationError{}
// Validate checks the field values on DescribeParcelResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *DescribeParcelResponse) Validate() error {
if m == nil {
return nil
}
if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DescribeParcelResponseValidationError{
field: "Value",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// DescribeParcelResponseValidationError is the validation error returned by
// DescribeParcelResponse.Validate if the designated constraints aren't met.
type DescribeParcelResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DescribeParcelResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DescribeParcelResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DescribeParcelResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DescribeParcelResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DescribeParcelResponseValidationError) ErrorName() string {
return "DescribeParcelResponseValidationError"
}
// Error satisfies the builtin error interface
func (e DescribeParcelResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDescribeParcelResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DescribeParcelResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DescribeParcelResponseValidationError{}
// Validate checks the field values on ListParcelsRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ListParcelsRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for Cursor
if m.GetOffset() <= 0 {
return ListParcelsRequestValidationError{
field: "Offset",
reason: "value must be greater than 0",
}
}
return nil
}
// ListParcelsRequestValidationError is the validation error returned by
// ListParcelsRequest.Validate if the designated constraints aren't met.
type ListParcelsRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListParcelsRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListParcelsRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListParcelsRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListParcelsRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListParcelsRequestValidationError) ErrorName() string {
return "ListParcelsRequestValidationError"
}
// Error satisfies the builtin error interface
func (e ListParcelsRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sListParcelsRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListParcelsRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListParcelsRequestValidationError{}
// Validate checks the field values on ListParcelsResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *ListParcelsResponse) Validate() error {
if m == nil {
return nil
}
for idx, item := range m.GetValue() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListParcelsResponseValidationError{
field: fmt.Sprintf("Value[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
return nil
}
// ListParcelsResponseValidationError is the validation error returned by
// ListParcelsResponse.Validate if the designated constraints aren't met.
type ListParcelsResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListParcelsResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListParcelsResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListParcelsResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListParcelsResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListParcelsResponseValidationError) ErrorName() string {
return "ListParcelsResponseValidationError"
}
// Error satisfies the builtin error interface
func (e ListParcelsResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sListParcelsResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListParcelsResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListParcelsResponseValidationError{}
// Validate checks the field values on RemoveParcelRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *RemoveParcelRequest) Validate() error {
if m == nil {
return nil
}
if m.GetParcelId() <= 0 {
return RemoveParcelRequestValidationError{
field: "ParcelId",
reason: "value must be greater than 0",
}
}
return nil
}
// RemoveParcelRequestValidationError is the validation error returned by
// RemoveParcelRequest.Validate if the designated constraints aren't met.
type RemoveParcelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RemoveParcelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RemoveParcelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RemoveParcelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RemoveParcelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RemoveParcelRequestValidationError) ErrorName() string {
return "RemoveParcelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e RemoveParcelRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRemoveParcelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RemoveParcelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RemoveParcelRequestValidationError{}
// Validate checks the field values on RemoveParcelResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *RemoveParcelResponse) Validate() error {
if m == nil {
return nil
}
// no validation rules for Success
return nil
}
// RemoveParcelResponseValidationError is the validation error returned by
// RemoveParcelResponse.Validate if the designated constraints aren't met.
type RemoveParcelResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RemoveParcelResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RemoveParcelResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RemoveParcelResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RemoveParcelResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RemoveParcelResponseValidationError) ErrorName() string {
return "RemoveParcelResponseValidationError"
}
// Error satisfies the builtin error interface
func (e RemoveParcelResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRemoveParcelResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RemoveParcelResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RemoveParcelResponseValidationError{}