command.validator.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. for _, item := range this.KeyColumns {
  220. if !(len(item) > 0) {
  221. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  222. }
  223. }
  224. for _, item := range this.TableRows {
  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("TableRows", err)
  228. }
  229. }
  230. }
  231. return nil
  232. }
  233. func (this *DeleteRequest) Validate() error {
  234. if this.DatabaseID == "" {
  235. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  236. }
  237. if this.TablePrefixWithSchema == "" {
  238. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  239. }
  240. if this.Version == "" {
  241. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  242. }
  243. // Validation of proto3 map<> fields is unsupported.
  244. return nil
  245. }
  246. func (this *DeleteBatchRequest) Validate() error {
  247. if this.DatabaseID == "" {
  248. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  249. }
  250. if len(this.Items) < 1 {
  251. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  252. }
  253. for _, item := range this.Items {
  254. if item != nil {
  255. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  256. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  257. }
  258. }
  259. }
  260. return nil
  261. }
  262. func (this *DeleteTableRowItem) Validate() error {
  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. if len(this.Items) < 1 {
  270. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  271. }
  272. for _, item := range this.Items {
  273. if item != nil {
  274. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  275. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  276. }
  277. }
  278. }
  279. return nil
  280. }
  281. func (this *DeleteItem) Validate() error {
  282. // Validation of proto3 map<> fields is unsupported.
  283. return nil
  284. }
  285. func (this *UpdateRequest) Validate() error {
  286. if this.DatabaseID == "" {
  287. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  288. }
  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. // Validation of proto3 map<> fields is unsupported.
  296. if this.NewTableRow != nil {
  297. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  298. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  299. }
  300. }
  301. return nil
  302. }
  303. func (this *ReplayRequest) Validate() error {
  304. if this.DatabaseID == "" {
  305. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  306. }
  307. if this.TablePrefixWithSchema == "" {
  308. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  309. }
  310. if this.Version == "" {
  311. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  312. }
  313. // Validation of proto3 map<> fields is unsupported.
  314. return nil
  315. }
  316. func (this *TableRow) Validate() error {
  317. for _, item := range this.Columns {
  318. if item != nil {
  319. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  320. return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
  321. }
  322. }
  323. }
  324. return nil
  325. }
  326. func (this *Column) Validate() error {
  327. if this.Value != nil {
  328. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
  329. return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
  330. }
  331. }
  332. return nil
  333. }
  334. func (this *ColumnValue) Validate() error {
  335. return nil
  336. }