-
Notifications
You must be signed in to change notification settings - Fork 1
/
create.validator.pb.go
191 lines (180 loc) · 10.9 KB
/
create.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
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
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: create.proto
package deploy
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
_ "github.com/easyopsapis/easyops-api-go/protorepo-models/easyops/model/cmdb"
_ "github.com/easyopsapis/easyops-api-go/protorepo-models/easyops/model/easy_flow"
_ "github.com/easyopsapis/easyops-api-go/protorepo-models/easyops/model/file_repository"
math "math"
regexp "regexp"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _regex_CreateRequest_AppId = regexp.MustCompile(`^[0-9a-z]{13}$`)
var _regex_CreateRequest_ClusterId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
var _regex_CreateRequest_TargetId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
var _regex_CreateRequest_InstanceId = regexp.MustCompile(`^[0-9a-z]{13}$`)
func (this *CreateRequest) Validate() error {
if this.Labels != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Labels); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Labels", err)
}
}
if !_regex_CreateRequest_AppId.MatchString(this.AppId) {
return github_com_mwitkow_go_proto_validators.FieldError("AppId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[0-9a-z]{13}$"`, this.AppId))
}
if !_regex_CreateRequest_ClusterId.MatchString(this.ClusterId) {
return github_com_mwitkow_go_proto_validators.FieldError("ClusterId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.ClusterId))
}
for _, item := range this.Batches {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Batches", err)
}
}
}
if !_regex_CreateRequest_TargetId.MatchString(this.TargetId) {
return github_com_mwitkow_go_proto_validators.FieldError("TargetId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.TargetId))
}
if !_regex_CreateRequest_InstanceId.MatchString(this.InstanceId) {
return github_com_mwitkow_go_proto_validators.FieldError("InstanceId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[0-9a-z]{13}$"`, this.InstanceId))
}
if this.Cluster != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Cluster); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Cluster", err)
}
}
for _, item := range this.InstanceInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("InstanceInfo", err)
}
}
}
if this.VersionInfo != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.VersionInfo); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("VersionInfo", err)
}
}
if this.PackageList != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PackageList); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PackageList", err)
}
}
return nil
}
func (this *CreateRequest_Batches) Validate() error {
for _, item := range this.Targets {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Targets", err)
}
}
}
return nil
}
var _regex_CreateRequest_InstanceInfo_PackageId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
var _regex_CreateRequest_InstanceInfo_InstallPath = regexp.MustCompile(`^((\/[^\/:\*\?""<>\|\r\n]+)+)|(\/)|[a-zA-Z]:(\\[^\\:\*\?""<>\|\r\n]+)*$`)
var _regex_CreateRequest_InstanceInfo_VersionId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
func (this *CreateRequest_InstanceInfo) Validate() error {
if !_regex_CreateRequest_InstanceInfo_PackageId.MatchString(this.PackageId) {
return github_com_mwitkow_go_proto_validators.FieldError("PackageId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.PackageId))
}
if !_regex_CreateRequest_InstanceInfo_InstallPath.MatchString(this.InstallPath) {
return github_com_mwitkow_go_proto_validators.FieldError("InstallPath", fmt.Errorf(`value '%v' must be a string conforming to regex "^((\\/[^\\/:\\*\\?\"\"<>\\|\\r\\n]+)+)|(\\/)|[a-zA-Z]:(\\\\[^\\\\:\\*\\?\"\"<>\\|\\r\\n]+)*$"`, this.InstallPath))
}
if !_regex_CreateRequest_InstanceInfo_VersionId.MatchString(this.VersionId) {
return github_com_mwitkow_go_proto_validators.FieldError("VersionId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.VersionId))
}
return nil
}
var _regex_CreateRequest_VersionInfo_VersionId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
var _regex_CreateRequest_VersionInfo_PackageId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
var _regex_CreateRequest_VersionInfo_Creator = regexp.MustCompile(`^[a-zA-Z0-9][.a-zA-Z0-9_-]{2,31}$`)
var _regex_CreateRequest_VersionInfo_Ctime = regexp.MustCompile(`^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])[T ](2[0-3]|[0-1][0-9]):([0-5][0-9]):[0-5][0-9](\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$`)
var _regex_CreateRequest_VersionInfo_Mtime = regexp.MustCompile(`^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])[T ](2[0-3]|[0-1][0-9]):([0-5][0-9]):[0-5][0-9](\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$`)
func (this *CreateRequest_VersionInfo) Validate() error {
if this.SourceDecode != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.SourceDecode); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SourceDecode", err)
}
}
for _, item := range this.Diff {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Diff", err)
}
}
}
if !(len(this.Name) > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Name))
}
if !(len(this.Name) < 46) {
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must have a length smaller than '46'`, this.Name))
}
if !_regex_CreateRequest_VersionInfo_VersionId.MatchString(this.VersionId) {
return github_com_mwitkow_go_proto_validators.FieldError("VersionId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.VersionId))
}
if !_regex_CreateRequest_VersionInfo_PackageId.MatchString(this.PackageId) {
return github_com_mwitkow_go_proto_validators.FieldError("PackageId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.PackageId))
}
if !(this.Org > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Org", fmt.Errorf(`value '%v' must be greater than '0'`, this.Org))
}
if !_regex_CreateRequest_VersionInfo_Creator.MatchString(this.Creator) {
return github_com_mwitkow_go_proto_validators.FieldError("Creator", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-zA-Z0-9][.a-zA-Z0-9_-]{2,31}$"`, this.Creator))
}
if !(len(this.Memo) > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Memo", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Memo))
}
if !_regex_CreateRequest_VersionInfo_Ctime.MatchString(this.Ctime) {
return github_com_mwitkow_go_proto_validators.FieldError("Ctime", fmt.Errorf(`value '%v' must be a string conforming to regex "^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])[T ](2[0-3]|[0-1][0-9]):([0-5][0-9]):[0-5][0-9](\\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"`, this.Ctime))
}
if !_regex_CreateRequest_VersionInfo_Mtime.MatchString(this.Mtime) {
return github_com_mwitkow_go_proto_validators.FieldError("Mtime", fmt.Errorf(`value '%v' must be a string conforming to regex "^((?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])[T ](2[0-3]|[0-1][0-9]):([0-5][0-9]):[0-5][0-9](\\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"`, this.Mtime))
}
return nil
}
func (this *CreateRequest_VersionInfo_SourceDecode) Validate() error {
return nil
}
var _regex_CreateRequest_PackageList_PackageId = regexp.MustCompile(`^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$`)
var _regex_CreateRequest_PackageList_InstallPath = regexp.MustCompile(`^((\/[^\/:\*\?""<>\|\r\n]+)+)|(\/)|[a-zA-Z]:(\\[^\\:\*\?""<>\|\r\n]+)*$`)
func (this *CreateRequest_PackageList) Validate() error {
if this.Cluster != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Cluster); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Cluster", err)
}
}
if !_regex_CreateRequest_PackageList_PackageId.MatchString(this.PackageId) {
return github_com_mwitkow_go_proto_validators.FieldError("PackageId", fmt.Errorf(`value '%v' must be a string conforming to regex "^[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}$"`, this.PackageId))
}
if !(len(this.Name) > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Name))
}
if !(len(this.Name) < 46) {
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must have a length smaller than '46'`, this.Name))
}
if !_regex_CreateRequest_PackageList_InstallPath.MatchString(this.InstallPath) {
return github_com_mwitkow_go_proto_validators.FieldError("InstallPath", fmt.Errorf(`value '%v' must be a string conforming to regex "^((\\/[^\\/:\\*\\?\"\"<>\\|\\r\\n]+)+)|(\\/)|[a-zA-Z]:(\\\\[^\\\\:\\*\\?\"\"<>\\|\\r\\n]+)*$"`, this.InstallPath))
}
return nil
}
func (this *CreateResponse) Validate() error {
return nil
}
func (this *CreateResponseWrapper) Validate() error {
if this.Data != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
return nil
}