-
Notifications
You must be signed in to change notification settings - Fork 14
/
sim_pool.validator.pb.go
126 lines (118 loc) · 3.84 KB
/
sim_pool.validator.pb.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
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: sim_pool.proto
package gen
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/known/wrapperspb"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/known/timestamppb"
regexp "regexp"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *GetSimsRequest) Validate() error {
return nil
}
func (this *GetSimsResponse) Validate() error {
for _, item := range this.Sims {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sims", err)
}
}
}
return nil
}
func (this *UpdateStatusRequest) Validate() error {
return nil
}
func (this *UpdateStatusResponse) Validate() error {
return nil
}
func (this *GetRequest) Validate() error {
return nil
}
func (this *GetResponse) Validate() error {
if this.Sim != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Sim); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sim", err)
}
}
return nil
}
func (this *GetByIccidRequest) Validate() error {
return nil
}
func (this *GetByIccidResponse) Validate() error {
if this.Sim != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Sim); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sim", err)
}
}
return nil
}
func (this *GetStatsRequest) Validate() error {
return nil
}
func (this *GetStatsResponse) Validate() error {
return nil
}
func (this *AddRequest) Validate() error {
for _, item := range this.Sim {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sim", err)
}
}
}
return nil
}
func (this *AddResponse) Validate() error {
for _, item := range this.Sim {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sim", err)
}
}
}
return nil
}
func (this *DeleteRequest) Validate() error {
return nil
}
func (this *DeleteResponse) Validate() error {
return nil
}
func (this *UploadRequest) Validate() error {
return nil
}
func (this *UploadResponse) Validate() error {
return nil
}
var _regex_Sim_Iccid = regexp.MustCompile(`^[0-9]{19}$`)
var _regex_Sim_Msisdn = regexp.MustCompile(`^$|^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$`)
func (this *Sim) Validate() error {
if !_regex_Sim_Iccid.MatchString(this.Iccid) {
return github_com_mwitkow_go_proto_validators.FieldError("Iccid", fmt.Errorf(`must be a valid ICCID format`))
}
if !_regex_Sim_Msisdn.MatchString(this.Msisdn) {
return github_com_mwitkow_go_proto_validators.FieldError("Msisdn", fmt.Errorf(`must be a phone number format`))
}
return nil
}
var _regex_AddSim_Iccid = regexp.MustCompile(`^[0-9]{19}$`)
var _regex_AddSim_Msisdn = regexp.MustCompile(`^$|^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$`)
func (this *AddSim) Validate() error {
if !_regex_AddSim_Iccid.MatchString(this.Iccid) {
return github_com_mwitkow_go_proto_validators.FieldError("Iccid", fmt.Errorf(`must be a valid ICCID format`))
}
if !_regex_AddSim_Msisdn.MatchString(this.Msisdn) {
return github_com_mwitkow_go_proto_validators.FieldError("Msisdn", fmt.Errorf(`must be a phone number format`))
}
return nil
}