| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- // 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.TableModelDescribe) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("TableModelDescribe", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.TableModelDescribe))
- }
- 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_InsertBatchRequest); ok {
- if oneOfNester.InsertBatchRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.InsertBatchRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("InsertBatchRequest", 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_DeleteBatchRequest); ok {
- if oneOfNester.DeleteBatchRequest != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(oneOfNester.DeleteBatchRequest); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("DeleteBatchRequest", 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))
- }
- for _, item := range this.KeyColumns {
- if !(len(item) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
- }
- }
- if this.TableRow != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
- }
- }
- return nil
- }
- func (this *InsertBatchRequest) 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 len(this.Items) < 1 {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
- }
- for _, item := range this.Items {
- if item != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
- }
- }
- }
- return nil
- }
- func (this *InsertTableItem) Validate() error {
- 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.Items) < 1 {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
- }
- for _, item := range this.Items {
- if item != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
- }
- }
- }
- return nil
- }
- func (this *InsertItem) Validate() error {
- for _, item := range this.KeyColumns {
- if !(len(item) > 0) {
- return github_com_mwitkow_go_proto_validators.FieldError("KeyColumns", fmt.Errorf(`value '%v' must have a length greater than '0'`, item))
- }
- }
- if this.TableRow != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TableRow); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("TableRow", err)
- }
- }
- 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))
- }
- // Validation of proto3 map<> fields is unsupported.
- return nil
- }
- func (this *DeleteBatchRequest) 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 len(this.Items) < 1 {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
- }
- for _, item := range this.Items {
- if item != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
- }
- }
- }
- return nil
- }
- func (this *DeleteTableItem) Validate() error {
- 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.Items) < 1 {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", fmt.Errorf(`value '%v' must contain at least 1 elements`, this.Items))
- }
- for _, item := range this.Items {
- if item != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
- }
- }
- }
- return nil
- }
- func (this *DeleteItem) Validate() error {
- // Validation of proto3 map<> fields is unsupported.
- 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))
- }
- // Validation of proto3 map<> fields is unsupported.
- if this.NewTableRow != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.NewTableRow); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("NewTableRow", err)
- }
- }
- 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))
- }
- // Validation of proto3 map<> fields is unsupported.
- 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
- }
- func (this *TableRow) Validate() error {
- for _, item := range this.Columns {
- if item != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("Columns", err)
- }
- }
- }
- return nil
- }
- func (this *Column) Validate() error {
- if this.Value != nil {
- if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Value); err != nil {
- return github_com_mwitkow_go_proto_validators.FieldError("Value", err)
- }
- }
- return nil
- }
- func (this *ColumnValue) Validate() error {
- return nil
- }
|