command.validator.pb.go 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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 *DeleteBatchTxRequest) Validate() error {
  92. if len(this.Items) < 1 {
  93. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  94. }
  95. for _, item := range this.Items {
  96. if item != nil {
  97. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  98. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  99. }
  100. }
  101. }
  102. return nil
  103. }
  104. func (this *UpdateTxRequest) Validate() error {
  105. if this.TablePrefixWithSchema == "" {
  106. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  107. }
  108. if this.Version == "" {
  109. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  110. }
  111. // Validation of proto3 map<> fields is unsupported.
  112. if this.NewTableRow != nil {
  113. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  114. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  115. }
  116. }
  117. return nil
  118. }
  119. func (this *TransactionEndRequest) Validate() error {
  120. return nil
  121. }
  122. func (this *TransactionOperation) Validate() error {
  123. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  124. if oneOfNester.TransactionBeginRequest != nil {
  125. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  126. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  127. }
  128. }
  129. }
  130. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertTxRequest); ok {
  131. if oneOfNester.InsertTxRequest != nil {
  132. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertTxRequest); err != nil {
  133. return github_com_mwitkow_go_proto_validators.FieldError("InsertTxRequest", err)
  134. }
  135. }
  136. }
  137. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertBatchTxRequest); ok {
  138. if oneOfNester.InsertBatchTxRequest != nil {
  139. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertBatchTxRequest); err != nil {
  140. return github_com_mwitkow_go_proto_validators.FieldError("InsertBatchTxRequest", err)
  141. }
  142. }
  143. }
  144. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteTxRequest); ok {
  145. if oneOfNester.DeleteTxRequest != nil {
  146. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteTxRequest); err != nil {
  147. return github_com_mwitkow_go_proto_validators.FieldError("DeleteTxRequest", err)
  148. }
  149. }
  150. }
  151. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteBatchTxRequest); ok {
  152. if oneOfNester.DeleteBatchTxRequest != nil {
  153. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteBatchTxRequest); err != nil {
  154. return github_com_mwitkow_go_proto_validators.FieldError("DeleteBatchTxRequest", err)
  155. }
  156. }
  157. }
  158. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateTxRequest); ok {
  159. if oneOfNester.UpdateTxRequest != nil {
  160. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateTxRequest); err != nil {
  161. return github_com_mwitkow_go_proto_validators.FieldError("UpdateTxRequest", err)
  162. }
  163. }
  164. }
  165. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  166. if oneOfNester.TransactionEndRequest != nil {
  167. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  168. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  169. }
  170. }
  171. }
  172. return nil
  173. }
  174. func (this *InsertRequest) Validate() error {
  175. if this.DatabaseID == "" {
  176. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  177. }
  178. if this.TablePrefixWithSchema == "" {
  179. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  180. }
  181. if this.Version == "" {
  182. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  183. }
  184. for _, item := range this.KeyColumns {
  185. if !(len(item) > 0) {
  186. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  187. }
  188. }
  189. if this.TableRow != nil {
  190. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  191. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  192. }
  193. }
  194. return nil
  195. }
  196. func (this *InsertBatchRequest) Validate() error {
  197. if this.DatabaseID == "" {
  198. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  199. }
  200. if len(this.Items) < 1 {
  201. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  202. }
  203. for _, item := range this.Items {
  204. if item != nil {
  205. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  206. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  207. }
  208. }
  209. }
  210. return nil
  211. }
  212. func (this *InsertTableRowItem) Validate() error {
  213. if this.TablePrefixWithSchema == "" {
  214. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  215. }
  216. if this.Version == "" {
  217. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  218. }
  219. if len(this.Items) < 1 {
  220. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  221. }
  222. for _, item := range this.Items {
  223. if item != nil {
  224. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  225. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  226. }
  227. }
  228. }
  229. return nil
  230. }
  231. func (this *InsertItem) Validate() error {
  232. for _, item := range this.KeyColumns {
  233. if !(len(item) > 0) {
  234. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  235. }
  236. }
  237. if this.TableRow != nil {
  238. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  239. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  240. }
  241. }
  242. return nil
  243. }
  244. func (this *DeleteRequest) Validate() error {
  245. if this.DatabaseID == "" {
  246. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  247. }
  248. if this.TablePrefixWithSchema == "" {
  249. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  250. }
  251. if this.Version == "" {
  252. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  253. }
  254. // Validation of proto3 map<> fields is unsupported.
  255. return nil
  256. }
  257. func (this *DeleteBatchRequest) Validate() error {
  258. if this.DatabaseID == "" {
  259. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  260. }
  261. if len(this.Items) < 1 {
  262. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  263. }
  264. for _, item := range this.Items {
  265. if item != nil {
  266. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  267. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  268. }
  269. }
  270. }
  271. return nil
  272. }
  273. func (this *DeleteTableRowItem) Validate() error {
  274. if this.TablePrefixWithSchema == "" {
  275. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  276. }
  277. if this.Version == "" {
  278. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  279. }
  280. if len(this.Items) < 1 {
  281. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  282. }
  283. for _, item := range this.Items {
  284. if item != nil {
  285. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  286. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  287. }
  288. }
  289. }
  290. return nil
  291. }
  292. func (this *DeleteItem) Validate() error {
  293. // Validation of proto3 map<> fields is unsupported.
  294. return nil
  295. }
  296. func (this *UpdateRequest) Validate() error {
  297. if this.DatabaseID == "" {
  298. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  299. }
  300. if this.TablePrefixWithSchema == "" {
  301. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  302. }
  303. if this.Version == "" {
  304. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  305. }
  306. // Validation of proto3 map<> fields is unsupported.
  307. if this.NewTableRow != nil {
  308. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  309. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  310. }
  311. }
  312. return nil
  313. }
  314. func (this *ReplayRequest) Validate() error {
  315. if this.DatabaseID == "" {
  316. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  317. }
  318. if this.TablePrefixWithSchema == "" {
  319. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  320. }
  321. if this.Version == "" {
  322. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  323. }
  324. // Validation of proto3 map<> fields is unsupported.
  325. return nil
  326. }
  327. func (this *TableRow) Validate() error {
  328. for _, item := range this.Columns {
  329. if item != nil {
  330. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  331. return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
  332. }
  333. }
  334. }
  335. return nil
  336. }
  337. func (this *Column) Validate() error {
  338. if this.Value != nil {
  339. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
  340. return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
  341. }
  342. }
  343. return nil
  344. }
  345. func (this *ColumnValue) Validate() error {
  346. return nil
  347. }