command.validator.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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 *TransactionOperation) Validate() error {
  59. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  60. if oneOfNester.TransactionBeginRequest != nil {
  61. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  62. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  63. }
  64. }
  65. }
  66. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertRequest); ok {
  67. if oneOfNester.InsertRequest != nil {
  68. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertRequest); err != nil {
  69. return github_com_mwitkow_go_proto_validators.FieldError("InsertRequest", err)
  70. }
  71. }
  72. }
  73. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertBatchRequest); ok {
  74. if oneOfNester.InsertBatchRequest != nil {
  75. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertBatchRequest); err != nil {
  76. return github_com_mwitkow_go_proto_validators.FieldError("InsertBatchRequest", err)
  77. }
  78. }
  79. }
  80. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteRequest); ok {
  81. if oneOfNester.DeleteRequest != nil {
  82. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteRequest); err != nil {
  83. return github_com_mwitkow_go_proto_validators.FieldError("DeleteRequest", err)
  84. }
  85. }
  86. }
  87. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteBatchRequest); ok {
  88. if oneOfNester.DeleteBatchRequest != nil {
  89. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteBatchRequest); err != nil {
  90. return github_com_mwitkow_go_proto_validators.FieldError("DeleteBatchRequest", err)
  91. }
  92. }
  93. }
  94. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateRequest); ok {
  95. if oneOfNester.UpdateRequest != nil {
  96. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateRequest); err != nil {
  97. return github_com_mwitkow_go_proto_validators.FieldError("UpdateRequest", err)
  98. }
  99. }
  100. }
  101. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  102. if oneOfNester.TransactionEndRequest != nil {
  103. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  104. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  105. }
  106. }
  107. }
  108. return nil
  109. }
  110. func (this *InsertRequest) Validate() error {
  111. if this.DatabaseID == "" {
  112. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  113. }
  114. if this.TablePrefixWithSchema == "" {
  115. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  116. }
  117. if this.Version == "" {
  118. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  119. }
  120. for _, item := range this.KeyColumns {
  121. if !(len(item) > 0) {
  122. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  123. }
  124. }
  125. if this.TableRow != nil {
  126. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  127. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  128. }
  129. }
  130. return nil
  131. }
  132. func (this *InsertBatchRequest) Validate() error {
  133. if this.DatabaseID == "" {
  134. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  135. }
  136. if len(this.Items) < 1 {
  137. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  138. }
  139. for _, item := range this.Items {
  140. if item != nil {
  141. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  142. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  143. }
  144. }
  145. }
  146. return nil
  147. }
  148. func (this *InsertTableItem) Validate() error {
  149. if this.TablePrefixWithSchema == "" {
  150. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  151. }
  152. if this.Version == "" {
  153. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  154. }
  155. if len(this.Items) < 1 {
  156. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  157. }
  158. for _, item := range this.Items {
  159. if item != nil {
  160. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  161. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  162. }
  163. }
  164. }
  165. return nil
  166. }
  167. func (this *InsertItem) Validate() error {
  168. for _, item := range this.KeyColumns {
  169. if !(len(item) > 0) {
  170. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  171. }
  172. }
  173. if this.TableRow != nil {
  174. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  175. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  176. }
  177. }
  178. return nil
  179. }
  180. func (this *DeleteRequest) Validate() error {
  181. if this.DatabaseID == "" {
  182. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  183. }
  184. if this.TablePrefixWithSchema == "" {
  185. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  186. }
  187. if this.Version == "" {
  188. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  189. }
  190. // Validation of proto3 map<> fields is unsupported.
  191. return nil
  192. }
  193. func (this *DeleteBatchRequest) Validate() error {
  194. if this.DatabaseID == "" {
  195. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  196. }
  197. if len(this.Items) < 1 {
  198. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  199. }
  200. for _, item := range this.Items {
  201. if item != nil {
  202. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  203. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  204. }
  205. }
  206. }
  207. return nil
  208. }
  209. func (this *DeleteTableItem) Validate() error {
  210. if this.TablePrefixWithSchema == "" {
  211. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  212. }
  213. if this.Version == "" {
  214. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  215. }
  216. if len(this.Items) < 1 {
  217. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  218. }
  219. for _, item := range this.Items {
  220. if item != nil {
  221. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  222. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  223. }
  224. }
  225. }
  226. return nil
  227. }
  228. func (this *DeleteItem) Validate() error {
  229. // Validation of proto3 map<> fields is unsupported.
  230. return nil
  231. }
  232. func (this *UpdateRequest) Validate() error {
  233. if this.DatabaseID == "" {
  234. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  235. }
  236. if this.TablePrefixWithSchema == "" {
  237. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  238. }
  239. if this.Version == "" {
  240. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  241. }
  242. // Validation of proto3 map<> fields is unsupported.
  243. if this.NewTableRow != nil {
  244. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  245. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  246. }
  247. }
  248. return nil
  249. }
  250. func (this *ReplayRequest) Validate() error {
  251. if this.DatabaseID == "" {
  252. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  253. }
  254. if this.TablePrefixWithSchema == "" {
  255. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  256. }
  257. if this.Version == "" {
  258. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  259. }
  260. // Validation of proto3 map<> fields is unsupported.
  261. return nil
  262. }
  263. func (this *TransactionBeginRequest) Validate() error {
  264. if this.DatabaseID == "" {
  265. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  266. }
  267. return nil
  268. }
  269. func (this *TransactionEndRequest) Validate() error {
  270. return nil
  271. }
  272. func (this *TableRow) Validate() error {
  273. for _, item := range this.Columns {
  274. if item != nil {
  275. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  276. return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
  277. }
  278. }
  279. }
  280. return nil
  281. }
  282. func (this *Column) Validate() error {
  283. if this.Value != nil {
  284. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
  285. return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
  286. }
  287. }
  288. return nil
  289. }
  290. func (this *ColumnValue) Validate() error {
  291. return nil
  292. }