| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- // Code generated by protoc-gen-gogo. DO NOT EDIT.
- // source: v1/request/command.proto
- package request
- import (
- fmt "fmt"
- math "math"
- proto "github.com/golang/protobuf/proto"
- _ "github.com/mwitkow/go-proto-validators"
- github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
- )
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- func (this *AutoMigrateRequest) Validate() error {
- if this.DatabaseID == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
- }
- if this.TablePrefixWithSchema == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
- }
- if this.Version == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
- }
- if !(len(this.Model) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("Model", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Model))
- }
- return nil
- }
- func (this *TransactionOperation) Validate() error {
- if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionBeginRequest); ok {
- if oneOfNester.TransactionBeginRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionBeginRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("TransactionBeginRequest", err)
- }
- }
- }
- if oneOfNester, ok := this.GetRequest().(*TransactionOperation_InsertRequest); ok {
- if oneOfNester.InsertRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("InsertRequest", err)
- }
- }
- }
- if oneOfNester, ok := this.GetRequest().(*TransactionOperation_DeleteRequest); ok {
- if oneOfNester.DeleteRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("DeleteRequest", err)
- }
- }
- }
- if oneOfNester, ok := this.GetRequest().(*TransactionOperation_UpdateRequest); ok {
- if oneOfNester.UpdateRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.UpdateRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("UpdateRequest", err)
- }
- }
- }
- if oneOfNester, ok := this.GetRequest().(*TransactionOperation_TransactionEndRequest); ok {
- if oneOfNester.TransactionEndRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.TransactionEndRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("TransactionEndRequest", err)
- }
- }
- }
- return nil
- }
- func (this *InsertRequest) Validate() error {
- if this.DatabaseID == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
- }
- if this.TablePrefixWithSchema == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
- }
- if this.Version == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
- }
- if !(len(this.Keys) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
- }
- if !(len(this.Models) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("Models", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Models))
- }
- return nil
- }
- func (this *DeleteRequest) Validate() error {
- if this.DatabaseID == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
- }
- if this.TablePrefixWithSchema == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
- }
- if this.Version == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
- }
- if !(len(this.Keys) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
- }
- return nil
- }
- func (this *UpdateRequest) Validate() error {
- if this.DatabaseID == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
- }
- if this.TablePrefixWithSchema == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
- }
- if this.Version == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
- }
- if !(len(this.Keys) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
- }
- if !(len(this.NewModel) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("NewModel", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.NewModel))
- }
- return nil
- }
- func (this *ReplayRequest) Validate() error {
- if this.DatabaseID == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
- }
- if this.TablePrefixWithSchema == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("TablePrefixWithSchema", fmt.Errorf(`value '%v' must not be an empty string`, this.TablePrefixWithSchema))
- }
- if this.Version == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("Version", fmt.Errorf(`value '%v' must not be an empty string`, this.Version))
- }
- if !(len(this.Keys) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("Keys", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Keys))
- }
- return nil
- }
- func (this *TransactionBeginRequest) Validate() error {
- if this.DatabaseID == "" {
- return github_com_mwitkow_go_proto_validators.FieldError("DatabaseID", fmt.Errorf(`value '%v' must not be an empty string`, this.DatabaseID))
- }
- return nil
- }
- func (this *TransactionEndRequest) Validate() error {
- return nil
- }
|