command.validator.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. for _, item := range this.KeyColumns {
  93. if !(len(item) > 0) {
  94. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  95. }
  96. }
  97. if this.TableRow != nil {
  98. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  99. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  100. }
  101. }
  102. return nil
  103. }
  104. func (this *InsertBatchRequest) Validate() error {
  105. if this.DatabaseID == "" {
  106. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  107. }
  108. if len(this.Items) < 1 {
  109. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  110. }
  111. for _, item := range this.Items {
  112. if item != nil {
  113. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  114. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  115. }
  116. }
  117. }
  118. return nil
  119. }
  120. func (this *InsertTableItem) Validate() error {
  121. if this.TablePrefixWithSchema == "" {
  122. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  123. }
  124. if this.Version == "" {
  125. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  126. }
  127. if len(this.Items) < 1 {
  128. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  129. }
  130. for _, item := range this.Items {
  131. if item != nil {
  132. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  133. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  134. }
  135. }
  136. }
  137. return nil
  138. }
  139. func (this *InsertItem) Validate() error {
  140. for _, item := range this.KeyColumns {
  141. if !(len(item) > 0) {
  142. return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
  143. }
  144. }
  145. if this.TableRow != nil {
  146. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
  147. return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
  148. }
  149. }
  150. return nil
  151. }
  152. func (this *DeleteRequest) Validate() error {
  153. if this.DatabaseID == "" {
  154. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  155. }
  156. if this.TablePrefixWithSchema == "" {
  157. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  158. }
  159. if this.Version == "" {
  160. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  161. }
  162. // Validation of proto3 map<> fields is unsupported.
  163. return nil
  164. }
  165. func (this *DeleteBatchRequest) Validate() error {
  166. if this.DatabaseID == "" {
  167. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  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 *DeleteTableItem) Validate() error {
  182. if this.TablePrefixWithSchema == "" {
  183. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  184. }
  185. if this.Version == "" {
  186. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  187. }
  188. if len(this.Items) < 1 {
  189. return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
  190. }
  191. for _, item := range this.Items {
  192. if item != nil {
  193. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  194. return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
  195. }
  196. }
  197. }
  198. return nil
  199. }
  200. func (this *DeleteItem) Validate() error {
  201. // Validation of proto3 map<> fields is unsupported.
  202. return nil
  203. }
  204. func (this *UpdateRequest) Validate() error {
  205. if this.DatabaseID == "" {
  206. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  207. }
  208. if this.TablePrefixWithSchema == "" {
  209. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  210. }
  211. if this.Version == "" {
  212. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  213. }
  214. // Validation of proto3 map<> fields is unsupported.
  215. if this.NewTableRow != nil {
  216. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
  217. return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
  218. }
  219. }
  220. return nil
  221. }
  222. func (this *ReplayRequest) Validate() error {
  223. if this.DatabaseID == "" {
  224. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  225. }
  226. if this.TablePrefixWithSchema == "" {
  227. return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
  228. }
  229. if this.Version == "" {
  230. return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
  231. }
  232. // Validation of proto3 map<> fields is unsupported.
  233. return nil
  234. }
  235. func (this *TransactionBeginRequest) Validate() error {
  236. if this.DatabaseID == "" {
  237. return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
  238. }
  239. return nil
  240. }
  241. func (this *TransactionEndRequest) Validate() error {
  242. return nil
  243. }
  244. func (this *TableRow) Validate() error {
  245. for _, item := range this.Columns {
  246. if item != nil {
  247. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
  248. return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
  249. }
  250. }
  251. }
  252. return nil
  253. }
  254. func (this *Column) Validate() error {
  255. if this.Value != nil {
  256. if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
  257. return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
  258. }
  259. }
  260. return nil
  261. }
  262. func (this *ColumnValue) Validate() error {
  263. return nil
  264. }