command.validator.pb.go 15 KB

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