command.validator.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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 *TransactionOperation) Validate() error {
  31. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
  32. if oneOfNester.TransactionBeginRequest != nil {
  33. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
  34. return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
  35. }
  36. }
  37. }
  38. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertRequest); ok {
  39. if oneOfNester.InsertRequest != nil {
  40. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertRequest); err != nil {
  41. return github_com_mwitkow_go_proto_validators.FieldError("InsertRequest", err)
  42. }
  43. }
  44. }
  45. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertBatchRequest); ok {
  46. if oneOfNester.InsertBatchRequest != nil {
  47. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertBatchRequest); err != nil {
  48. return github_com_mwitkow_go_proto_validators.FieldError("InsertBatchRequest", err)
  49. }
  50. }
  51. }
  52. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteRequest); ok {
  53. if oneOfNester.DeleteRequest != nil {
  54. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteRequest); err != nil {
  55. return github_com_mwitkow_go_proto_validators.FieldError("DeleteRequest", err)
  56. }
  57. }
  58. }
  59. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteBatchRequest); ok {
  60. if oneOfNester.DeleteBatchRequest != nil {
  61. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteBatchRequest); err != nil {
  62. return github_com_mwitkow_go_proto_validators.FieldError("DeleteBatchRequest", err)
  63. }
  64. }
  65. }
  66. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateRequest); ok {
  67. if oneOfNester.UpdateRequest != nil {
  68. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateRequest); err != nil {
  69. return github_com_mwitkow_go_proto_validators.FieldError("UpdateRequest", err)
  70. }
  71. }
  72. }
  73. if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
  74. if oneOfNester.TransactionEndRequest != nil {
  75. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
  76. return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
  77. }
  78. }
  79. }
  80. return nil
  81. }
  82. func (this *InsertRequest) Validate() error {
  83. if this.DatabaseID == "" {
  84. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  85. }
  86. if this.TablePrefixWithSchema == "" {
  87. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  88. }
  89. if this.Version == "" {
  90. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  91. }
  92. if !(len(this.Keys) > 0) {
  93. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  94. }
  95. if !(len(this.TableRow) > 0) {
  96. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.TableRow))
  97. }
  98. return nil
  99. }
  100. func (this *InsertBatchRequest) Validate() error {
  101. if this.DatabaseID == "" {
  102. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  103. }
  104. if len(this.Items) < 1 {
  105. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  106. }
  107. for _, item := range this.Items {
  108. if item != nil {
  109. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  110. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  111. }
  112. }
  113. }
  114. return nil
  115. }
  116. func (this *InsertTableItem) Validate() error {
  117. if this.TablePrefixWithSchema == "" {
  118. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  119. }
  120. if this.Version == "" {
  121. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  122. }
  123. if len(this.Items) < 1 {
  124. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  125. }
  126. for _, item := range this.Items {
  127. if item != nil {
  128. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  129. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  130. }
  131. }
  132. }
  133. return nil
  134. }
  135. func (this *InsertItem) Validate() error {
  136. if !(len(this.Keys) > 0) {
  137. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  138. }
  139. if !(len(this.TableRow) > 0) {
  140. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.TableRow))
  141. }
  142. return nil
  143. }
  144. func (this *DeleteRequest) Validate() error {
  145. if this.DatabaseID == "" {
  146. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  147. }
  148. if this.TablePrefixWithSchema == "" {
  149. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  150. }
  151. if this.Version == "" {
  152. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  153. }
  154. if !(len(this.Keys) > 0) {
  155. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  156. }
  157. return nil
  158. }
  159. func (this *DeleteBatchRequest) Validate() error {
  160. if this.DatabaseID == "" {
  161. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  162. }
  163. if len(this.Items) < 1 {
  164. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  165. }
  166. for _, item := range this.Items {
  167. if item != nil {
  168. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  169. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  170. }
  171. }
  172. }
  173. return nil
  174. }
  175. func (this *DeleteTableItem) Validate() error {
  176. if this.TablePrefixWithSchema == "" {
  177. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  178. }
  179. if this.Version == "" {
  180. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  181. }
  182. if len(this.Items) < 1 {
  183. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  184. }
  185. for _, item := range this.Items {
  186. if item != nil {
  187. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  188. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  189. }
  190. }
  191. }
  192. return nil
  193. }
  194. func (this *DeleteItem) Validate() error {
  195. if !(len(this.Keys) > 0) {
  196. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  197. }
  198. return nil
  199. }
  200. func (this *UpdateRequest) Validate() error {
  201. if this.DatabaseID == "" {
  202. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  203. }
  204. if this.TablePrefixWithSchema == "" {
  205. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  206. }
  207. if this.Version == "" {
  208. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  209. }
  210. if !(len(this.Keys) > 0) {
  211. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  212. }
  213. if !(len(this.NewTableRow) > 0) {
  214. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.NewTableRow))
  215. }
  216. return nil
  217. }
  218. func (this *ReplayRequest) Validate() error {
  219. if this.DatabaseID == "" {
  220. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  221. }
  222. if this.TablePrefixWithSchema == "" {
  223. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  224. }
  225. if this.Version == "" {
  226. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  227. }
  228. if !(len(this.Keys) > 0) {
  229. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  230. }
  231. return nil
  232. }
  233. func (this *TransactionBeginRequest) 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. return nil
  238. }
  239. func (this *TransactionEndRequest) Validate() error {
  240. return nil
  241. }