command.validator.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 *InsertItem) 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.Keys) > 0) {
  124. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  125. }
  126. if !(len(this.TableRow) > 0) {
  127. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.TableRow))
  128. }
  129. return nil
  130. }
  131. func (this *DeleteRequest) Validate() error {
  132. if this.DatabaseID == "" {
  133. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  134. }
  135. if this.TablePrefixWithSchema == "" {
  136. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  137. }
  138. if this.Version == "" {
  139. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  140. }
  141. if !(len(this.Keys) > 0) {
  142. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  143. }
  144. return nil
  145. }
  146. func (this *DeleteBatchRequest) Validate() error {
  147. if this.DatabaseID == "" {
  148. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  149. }
  150. if len(this.Items) < 1 {
  151. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  152. }
  153. for _, item := range this.Items {
  154. if item != nil {
  155. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  156. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  157. }
  158. }
  159. }
  160. return nil
  161. }
  162. func (this *DeleteTableItem) Validate() error {
  163. if this.TablePrefixWithSchema == "" {
  164. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  165. }
  166. if this.Version == "" {
  167. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  168. }
  169. if len(this.Items) < 1 {
  170. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  171. }
  172. for _, item := range this.Items {
  173. if item != nil {
  174. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  175. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  176. }
  177. }
  178. }
  179. return nil
  180. }
  181. func (this *DeleteItem) Validate() error {
  182. if !(len(this.Keys) > 0) {
  183. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  184. }
  185. return nil
  186. }
  187. func (this *UpdateRequest) Validate() error {
  188. if this.DatabaseID == "" {
  189. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  190. }
  191. if this.TablePrefixWithSchema == "" {
  192. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  193. }
  194. if this.Version == "" {
  195. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  196. }
  197. if !(len(this.Keys) > 0) {
  198. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  199. }
  200. if !(len(this.NewTableRow) > 0) {
  201. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.NewTableRow))
  202. }
  203. return nil
  204. }
  205. func (this *ReplayRequest) Validate() error {
  206. if this.DatabaseID == "" {
  207. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  208. }
  209. if this.TablePrefixWithSchema == "" {
  210. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  211. }
  212. if this.Version == "" {
  213. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  214. }
  215. if !(len(this.Keys) > 0) {
  216. return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
  217. }
  218. return nil
  219. }
  220. func (this *TransactionBeginRequest) Validate() error {
  221. if this.DatabaseID == "" {
  222. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  223. }
  224. return nil
  225. }
  226. func (this *TransactionEndRequest) Validate() error {
  227. return nil
  228. }