github.com/s7techlab/cckit@v0.10.5/examples/token/service/allowance/allowance.validator.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: token/service/allowance/allowance.proto 3 4 package allowance 5 6 import ( 7 fmt "fmt" 8 proto "github.com/golang/protobuf/proto" 9 _ "github.com/mwitkow/go-proto-validators" 10 github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" 11 _ "google.golang.org/genproto/googleapis/api/annotations" 12 _ "google.golang.org/protobuf/types/known/emptypb" 13 math "math" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 func (this *AllowanceRequest) Validate() error { 22 if this.OwnerAddress == "" { 23 return github_com_mwitkow_go_proto_validators.FieldError("OwnerAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.OwnerAddress)) 24 } 25 if this.SpenderAddress == "" { 26 return github_com_mwitkow_go_proto_validators.FieldError("SpenderAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.SpenderAddress)) 27 } 28 return nil 29 } 30 func (this *ApproveRequest) Validate() error { 31 if this.OwnerAddress == "" { 32 return github_com_mwitkow_go_proto_validators.FieldError("OwnerAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.OwnerAddress)) 33 } 34 if this.SpenderAddress == "" { 35 return github_com_mwitkow_go_proto_validators.FieldError("SpenderAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.SpenderAddress)) 36 } 37 if !(this.Amount > 0) { 38 return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must be greater than '0'`, this.Amount)) 39 } 40 return nil 41 } 42 func (this *TransferFromRequest) Validate() error { 43 if this.OwnerAddress == "" { 44 return github_com_mwitkow_go_proto_validators.FieldError("OwnerAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.OwnerAddress)) 45 } 46 if this.RecipientAddress == "" { 47 return github_com_mwitkow_go_proto_validators.FieldError("RecipientAddress", fmt.Errorf(`value '%v' must not be an empty string`, this.RecipientAddress)) 48 } 49 if !(this.Amount > 0) { 50 return github_com_mwitkow_go_proto_validators.FieldError("Amount", fmt.Errorf(`value '%v' must be greater than '0'`, this.Amount)) 51 } 52 return nil 53 } 54 func (this *TransferFromResponse) Validate() error { 55 return nil 56 } 57 func (this *AllowanceId) Validate() error { 58 return nil 59 } 60 func (this *Allowance) Validate() error { 61 return nil 62 } 63 func (this *Allowances) Validate() error { 64 for _, item := range this.Items { 65 if item != nil { 66 if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { 67 return github_com_mwitkow_go_proto_validators.FieldError("Items", err) 68 } 69 } 70 } 71 return nil 72 } 73 func (this *Approved) Validate() error { 74 return nil 75 } 76 func (this *TransferredFrom) Validate() error { 77 return nil 78 }