This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathpayload.validator.pb.go
96 lines (92 loc) · 4.12 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
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cpaper_extended/schema/payload.proto
package schema
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/known/timestamppb"
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 *IssueCommercialPaper) Validate() error {
if this.Issuer == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
}
if this.PaperNumber == "" {
return github_com_mwitkow_go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
}
if nil == this.IssueDate {
return github_com_mwitkow_go_proto_validators.FieldError("IssueDate", fmt.Errorf("message must exist"))
}
if this.IssueDate != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.IssueDate); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("IssueDate", err)
}
}
if nil == this.MaturityDate {
return github_com_mwitkow_go_proto_validators.FieldError("MaturityDate", fmt.Errorf("message must exist"))
}
if this.MaturityDate != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MaturityDate); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("MaturityDate", err)
}
}
if !(this.FaceValue > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("FaceValue", fmt.Errorf(`value '%v' must be greater than '0'`, this.FaceValue))
}
if this.ExternalId == "" {
return github_com_mwitkow_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 github_com_mwitkow_go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
}
if this.PaperNumber == "" {
return github_com_mwitkow_go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
}
if this.CurrentOwner == "" {
return github_com_mwitkow_go_proto_validators.FieldError("CurrentOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.CurrentOwner))
}
if this.NewOwner == "" {
return github_com_mwitkow_go_proto_validators.FieldError("NewOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.NewOwner))
}
if !(this.Price > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Price", fmt.Errorf(`value '%v' must be greater than '0'`, this.Price))
}
if nil == this.PurchaseDate {
return github_com_mwitkow_go_proto_validators.FieldError("PurchaseDate", fmt.Errorf("message must exist"))
}
if this.PurchaseDate != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PurchaseDate); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PurchaseDate", err)
}
}
return nil
}
func (this *RedeemCommercialPaper) Validate() error {
if this.Issuer == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
}
if this.PaperNumber == "" {
return github_com_mwitkow_go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
}
if this.RedeemingOwner == "" {
return github_com_mwitkow_go_proto_validators.FieldError("RedeemingOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.RedeemingOwner))
}
if nil == this.RedeemDate {
return github_com_mwitkow_go_proto_validators.FieldError("RedeemDate", fmt.Errorf("message must exist"))
}
if this.RedeemDate != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.RedeemDate); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("RedeemDate", err)
}
}
return nil
}