github.com/s7techlab/cckit@v0.10.5/examples/cpaper_asservice/cpaper.validator.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: cpaper_asservice/cpaper.proto
     3  
     4  package cpaper_asservice
     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  	_ "google.golang.org/protobuf/types/known/timestamppb"
    14  	math "math"
    15  )
    16  
    17  // Reference imports to suppress errors if they are not otherwise used.
    18  var _ = proto.Marshal
    19  var _ = fmt.Errorf
    20  var _ = math.Inf
    21  
    22  func (this *CommercialPaper) Validate() error {
    23  	if this.IssueDate != nil {
    24  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.IssueDate); err != nil {
    25  			return github_com_mwitkow_go_proto_validators.FieldError("IssueDate", err)
    26  		}
    27  	}
    28  	if this.MaturityDate != nil {
    29  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MaturityDate); err != nil {
    30  			return github_com_mwitkow_go_proto_validators.FieldError("MaturityDate", err)
    31  		}
    32  	}
    33  	return nil
    34  }
    35  func (this *CommercialPaperId) Validate() error {
    36  	return nil
    37  }
    38  func (this *ExternalId) Validate() error {
    39  	return nil
    40  }
    41  func (this *CommercialPaperList) Validate() error {
    42  	for _, item := range this.Items {
    43  		if item != nil {
    44  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    45  				return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
    46  			}
    47  		}
    48  	}
    49  	return nil
    50  }
    51  func (this *IssueCommercialPaper) Validate() error {
    52  	if this.Issuer == "" {
    53  		return github_com_mwitkow_go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
    54  	}
    55  	if this.PaperNumber == "" {
    56  		return github_com_mwitkow_go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
    57  	}
    58  	if nil == this.IssueDate {
    59  		return github_com_mwitkow_go_proto_validators.FieldError("IssueDate", fmt.Errorf("message must exist"))
    60  	}
    61  	if this.IssueDate != nil {
    62  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.IssueDate); err != nil {
    63  			return github_com_mwitkow_go_proto_validators.FieldError("IssueDate", err)
    64  		}
    65  	}
    66  	if nil == this.MaturityDate {
    67  		return github_com_mwitkow_go_proto_validators.FieldError("MaturityDate", fmt.Errorf("message must exist"))
    68  	}
    69  	if this.MaturityDate != nil {
    70  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.MaturityDate); err != nil {
    71  			return github_com_mwitkow_go_proto_validators.FieldError("MaturityDate", err)
    72  		}
    73  	}
    74  	if !(this.FaceValue > 0) {
    75  		return github_com_mwitkow_go_proto_validators.FieldError("FaceValue", fmt.Errorf(`value '%v' must be greater than '0'`, this.FaceValue))
    76  	}
    77  	if this.ExternalId == "" {
    78  		return github_com_mwitkow_go_proto_validators.FieldError("ExternalId", fmt.Errorf(`value '%v' must not be an empty string`, this.ExternalId))
    79  	}
    80  	return nil
    81  }
    82  func (this *BuyCommercialPaper) Validate() error {
    83  	if this.Issuer == "" {
    84  		return github_com_mwitkow_go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
    85  	}
    86  	if this.PaperNumber == "" {
    87  		return github_com_mwitkow_go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
    88  	}
    89  	if this.CurrentOwner == "" {
    90  		return github_com_mwitkow_go_proto_validators.FieldError("CurrentOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.CurrentOwner))
    91  	}
    92  	if this.NewOwner == "" {
    93  		return github_com_mwitkow_go_proto_validators.FieldError("NewOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.NewOwner))
    94  	}
    95  	if !(this.Price > 0) {
    96  		return github_com_mwitkow_go_proto_validators.FieldError("Price", fmt.Errorf(`value '%v' must be greater than '0'`, this.Price))
    97  	}
    98  	if nil == this.PurchaseDate {
    99  		return github_com_mwitkow_go_proto_validators.FieldError("PurchaseDate", fmt.Errorf("message must exist"))
   100  	}
   101  	if this.PurchaseDate != nil {
   102  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.PurchaseDate); err != nil {
   103  			return github_com_mwitkow_go_proto_validators.FieldError("PurchaseDate", err)
   104  		}
   105  	}
   106  	return nil
   107  }
   108  func (this *RedeemCommercialPaper) Validate() error {
   109  	if this.Issuer == "" {
   110  		return github_com_mwitkow_go_proto_validators.FieldError("Issuer", fmt.Errorf(`value '%v' must not be an empty string`, this.Issuer))
   111  	}
   112  	if this.PaperNumber == "" {
   113  		return github_com_mwitkow_go_proto_validators.FieldError("PaperNumber", fmt.Errorf(`value '%v' must not be an empty string`, this.PaperNumber))
   114  	}
   115  	if this.RedeemingOwner == "" {
   116  		return github_com_mwitkow_go_proto_validators.FieldError("RedeemingOwner", fmt.Errorf(`value '%v' must not be an empty string`, this.RedeemingOwner))
   117  	}
   118  	if nil == this.RedeemDate {
   119  		return github_com_mwitkow_go_proto_validators.FieldError("RedeemDate", fmt.Errorf("message must exist"))
   120  	}
   121  	if this.RedeemDate != nil {
   122  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.RedeemDate); err != nil {
   123  			return github_com_mwitkow_go_proto_validators.FieldError("RedeemDate", err)
   124  		}
   125  	}
   126  	return nil
   127  }