command.validator.pb.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: v1/request/command.proto
  3. package request
  4. import (
  5. fmt "fmt"
  6. math "math"
  7. proto "github.com/golang/protobuf/proto"
  8. _ "github.com/mwitkow/go-proto-validators"
  9. github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. func (this *AutoMigrateRequest) Validate() error {
  16. if this.DatabaseID == "" {
  17. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  18. }
  19. if len(this.Items) < 1 {
  20. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  21. }
  22. for _, item := range this.Items {
  23. if item != nil {
  24. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  25. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  26. }
  27. }
  28. }
  29. return nil
  30. }
  31. func (this *AutoMigrateItem) Validate() error {
  32. if this.TablePrefixWithSchema == "" {
  33. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  34. }
  35. if this.Version == "" {
  36. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  37. }
  38. if !(len(this.TableModelDescribe) > 0) {
  39. return github_com_mwitkow_go_proto_validators.FieldError("TableModelDescribe", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.TableModelDescribe))
  40. }
  41. return nil
  42. }
  43. func (this *TransactionBeginRequest) Validate() error {
  44. if this.DatabaseID == "" {
  45. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  46. }
  47. return nil
  48. }
  49. func (this *InsertTxRequest) Validate() error {
  50. if this.TablePrefixWithSchema == "" {
  51. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  52. }
  53. if this.Version == "" {
  54. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  55. }
  56. for _, item := range this.KeyColumns {
  57. if !(len(item) > 0) {
  58. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  59. }
  60. }
  61. if this.TableRow != nil {
  62. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  63. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  64. }
  65. }
  66. return nil
  67. }
  68. func (this *InsertBatchTxRequest) Validate() error {
  69. if len(this.Items) < 1 {
  70. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  71. }
  72. for _, item := range this.Items {
  73. if item != nil {
  74. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  75. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  76. }
  77. }
  78. }
  79. return nil
  80. }
  81. func (this *DeleteTxRequest) Validate() error {
  82. if this.TablePrefixWithSchema == "" {
  83. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  84. }
  85. if this.Version == "" {
  86. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  87. }
  88. // Validation of proto3 map<> fields is unsupported.
  89. return nil
  90. }
  91. func (this *DeleteWhereTxRequest) Validate() error {
  92. if this.TablePrefixWithSchema == "" {
  93. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  94. }
  95. if this.Version == "" {
  96. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  97. }
  98. for _, item := range this.KeyColumns {
  99. if !(len(item) > 0) {
  100. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  101. }
  102. }
  103. return nil
  104. }
  105. func (this *DeleteBatchTxRequest) Validate() error {
  106. if len(this.Items) < 1 {
  107. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  108. }
  109. for _, item := range this.Items {
  110. if item != nil {
  111. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  112. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  113. }
  114. }
  115. }
  116. return nil
  117. }
  118. func (this *UpdateTxRequest) Validate() error {
  119. if this.TablePrefixWithSchema == "" {
  120. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  121. }
  122. if this.Version == "" {
  123. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  124. }
  125. // Validation of proto3 map<> fields is unsupported.
  126. if this.NewTableRow != nil {
  127. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  128. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  129. }
  130. }
  131. return nil
  132. }
  133. func (this *TransactionEndRequest) Validate() error {
  134. return nil
  135. }
  136. func (this *TransactionOperation) Validate() error {
  137. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  138. if oneOfNester.TransactionBeginRequest != nil {
  139. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  140. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  141. }
  142. }
  143. }
  144. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertTxRequest); ok {
  145. if oneOfNester.InsertTxRequest != nil {
  146. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertTxRequest); err != nil {
  147. return github_com_mwitkow_go_proto_validators.FieldError("InsertTxRequest", err)
  148. }
  149. }
  150. }
  151. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertBatchTxRequest); ok {
  152. if oneOfNester.InsertBatchTxRequest != nil {
  153. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertBatchTxRequest); err != nil {
  154. return github_com_mwitkow_go_proto_validators.FieldError("InsertBatchTxRequest", err)
  155. }
  156. }
  157. }
  158. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteTxRequest); ok {
  159. if oneOfNester.DeleteTxRequest != nil {
  160. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteTxRequest); err != nil {
  161. return github_com_mwitkow_go_proto_validators.FieldError("DeleteTxRequest", err)
  162. }
  163. }
  164. }
  165. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteWhereTxRequest); ok {
  166. if oneOfNester.DeleteWhereTxRequest != nil {
  167. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteWhereTxRequest); err != nil {
  168. return github_com_mwitkow_go_proto_validators.FieldError("DeleteWhereTxRequest", err)
  169. }
  170. }
  171. }
  172. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteBatchTxRequest); ok {
  173. if oneOfNester.DeleteBatchTxRequest != nil {
  174. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteBatchTxRequest); err != nil {
  175. return github_com_mwitkow_go_proto_validators.FieldError("DeleteBatchTxRequest", err)
  176. }
  177. }
  178. }
  179. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateTxRequest); ok {
  180. if oneOfNester.UpdateTxRequest != nil {
  181. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateTxRequest); err != nil {
  182. return github_com_mwitkow_go_proto_validators.FieldError("UpdateTxRequest", err)
  183. }
  184. }
  185. }
  186. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  187. if oneOfNester.TransactionEndRequest != nil {
  188. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  189. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  190. }
  191. }
  192. }
  193. return nil
  194. }
  195. func (this *InsertRequest) Validate() error {
  196. if this.DatabaseID == "" {
  197. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  198. }
  199. if this.TablePrefixWithSchema == "" {
  200. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  201. }
  202. if this.Version == "" {
  203. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  204. }
  205. for _, item := range this.KeyColumns {
  206. if !(len(item) > 0) {
  207. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  208. }
  209. }
  210. if this.TableRow != nil {
  211. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  212. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  213. }
  214. }
  215. return nil
  216. }
  217. func (this *InsertBatchRequest) Validate() error {
  218. if this.DatabaseID == "" {
  219. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  220. }
  221. if len(this.Items) < 1 {
  222. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  223. }
  224. for _, item := range this.Items {
  225. if item != nil {
  226. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  227. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  228. }
  229. }
  230. }
  231. return nil
  232. }
  233. func (this *InsertTableRowItem) Validate() error {
  234. if this.TablePrefixWithSchema == "" {
  235. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  236. }
  237. if this.Version == "" {
  238. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  239. }
  240. for _, item := range this.KeyColumns {
  241. if !(len(item) > 0) {
  242. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  243. }
  244. }
  245. for _, item := range this.TableRows {
  246. if item != nil {
  247. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  248. return github_com_mwitkow_go_proto_validators.FieldError("TableRows", err)
  249. }
  250. }
  251. }
  252. return nil
  253. }
  254. func (this *DeleteRequest) Validate() error {
  255. if this.DatabaseID == "" {
  256. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  257. }
  258. if this.TablePrefixWithSchema == "" {
  259. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  260. }
  261. if this.Version == "" {
  262. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  263. }
  264. // Validation of proto3 map<> fields is unsupported.
  265. return nil
  266. }
  267. func (this *DeleteWhereRequest) Validate() error {
  268. if this.DatabaseID == "" {
  269. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  270. }
  271. if this.TablePrefixWithSchema == "" {
  272. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  273. }
  274. if this.Version == "" {
  275. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  276. }
  277. for _, item := range this.KeyColumns {
  278. if !(len(item) > 0) {
  279. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  280. }
  281. }
  282. return nil
  283. }
  284. func (this *DeleteBatchRequest) Validate() error {
  285. if this.DatabaseID == "" {
  286. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  287. }
  288. if len(this.Items) < 1 {
  289. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  290. }
  291. for _, item := range this.Items {
  292. if item != nil {
  293. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  294. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  295. }
  296. }
  297. }
  298. return nil
  299. }
  300. func (this *DeleteTableRowItem) Validate() error {
  301. if this.TablePrefixWithSchema == "" {
  302. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  303. }
  304. if this.Version == "" {
  305. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  306. }
  307. if len(this.Items) < 1 {
  308. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  309. }
  310. for _, item := range this.Items {
  311. if item != nil {
  312. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  313. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  314. }
  315. }
  316. }
  317. return nil
  318. }
  319. func (this *DeleteItem) Validate() error {
  320. // Validation of proto3 map<> fields is unsupported.
  321. return nil
  322. }
  323. func (this *UpdateRequest) Validate() error {
  324. if this.DatabaseID == "" {
  325. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  326. }
  327. if this.TablePrefixWithSchema == "" {
  328. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  329. }
  330. if this.Version == "" {
  331. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  332. }
  333. // Validation of proto3 map<> fields is unsupported.
  334. if this.NewTableRow != nil {
  335. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  336. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  337. }
  338. }
  339. return nil
  340. }
  341. func (this *ReplayRequest) Validate() error {
  342. if this.DatabaseID == "" {
  343. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  344. }
  345. if this.TablePrefixWithSchema == "" {
  346. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  347. }
  348. if this.Version == "" {
  349. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  350. }
  351. // Validation of proto3 map<> fields is unsupported.
  352. return nil
  353. }
  354. func (this *TableRow) Validate() error {
  355. for _, item := range this.Columns {
  356. if item != nil {
  357. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  358. return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
  359. }
  360. }
  361. }
  362. return nil
  363. }
  364. func (this *Column) Validate() error {
  365. if this.Value != nil {
  366. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
  367. return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
  368. }
  369. }
  370. return nil
  371. }
  372. func (this *ColumnValue) Validate() error {
  373. return nil
  374. }