forked from s7techlab/cckit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payload.validator.pb.go
109 lines (103 loc) · 3.92 KB
/
payload.validator.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: payload.proto
/*
Package schema is a generated protocol buffer package.
It is generated from these files:
payload.proto
state.proto
It has these top-level messages:
IssueCommercialPaper
BuyCommercialPaper
RedeemCommercialPaper
CommercialPaper
CommercialPaperId
CommercialPaperList
*/
package schema
import fmt "fmt"
import go_proto_validators "github.com/mwitkow/go-proto-validators"
import proto "github.com/golang/protobuf/proto"
import math "math"
import _ "github.com/golang/protobuf/ptypes/timestamp"
import _ "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 *IssueCommercialPaper) Validate() error {
if this.Issuer == "" {
return go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
}
if this.PaperNumber == "" {
return go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
}
if nil == this.IssueDate {
return go_proto_validators.FieldError("IssueDate", fmt.Errorf("message must exist"))
}
if this.IssueDate != nil {
if err := go_proto_validators.CallValidatorIfExists(this.IssueDate); err != nil {
return go_proto_validators.FieldError("IssueDate", err)
}
}
if nil == this.MaturityDate {
return go_proto_validators.FieldError("MaturityDate", fmt.Errorf("message must exist"))
}
if this.MaturityDate != nil {
if err := go_proto_validators.CallValidatorIfExists(this.MaturityDate); err != nil {
return go_proto_validators.FieldError("MaturityDate", err)
}
}
if !(this.FaceValue > 0) {
return go_proto_validators.FieldError("FaceValue", fmt.Errorf(`value '%v' must be greater than '0'`, this.FaceValue))
}
if this.ExternalId == "" {
return go_proto_validators.FieldError("ExternalId", fmt.Errorf(`value '%v' must not be an empty string`, this.ExternalId))
}
return nil
}
func (this *BuyCommercialPaper) Validate() error {
if this.Issuer == "" {
return go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
}
if this.PaperNumber == "" {
return go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
}
if this.CurrentOwner == "" {
return go_proto_validators.FieldError("CurrentOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.CurrentOwner))
}
if this.NewOwner == "" {
return go_proto_validators.FieldError("NewOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.NewOwner))
}
if !(this.Price > 0) {
return go_proto_validators.FieldError("Price", fmt.Errorf(`value '%v' must be greater than '0'`, this.Price))
}
if nil == this.PurchaseDate {
return go_proto_validators.FieldError("PurchaseDate", fmt.Errorf("message must exist"))
}
if this.PurchaseDate != nil {
if err := go_proto_validators.CallValidatorIfExists(this.PurchaseDate); err != nil {
return go_proto_validators.FieldError("PurchaseDate", err)
}
}
return nil
}
func (this *RedeemCommercialPaper) Validate() error {
if this.Issuer == "" {
return go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
}
if this.PaperNumber == "" {
return go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
}
if this.RedeemingOwner == "" {
return go_proto_validators.FieldError("RedeemingOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.RedeemingOwner))
}
if nil == this.RedeemDate {
return go_proto_validators.FieldError("RedeemDate", fmt.Errorf("message must exist"))
}
if this.RedeemDate != nil {
if err := go_proto_validators.CallValidatorIfExists(this.RedeemDate); err != nil {
return go_proto_validators.FieldError("RedeemDate", err)
}
}
return nil
}