github.com/s7techlab/cckit@v0.10.5/extensions/owner/chaincode_owner.validator.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: owner/chaincode_owner.proto
     3  
     4  package owner
     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 *ChaincodeOwners) Validate() error {
    23  	for _, item := range this.Items {
    24  		if item != nil {
    25  			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
    26  				return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
    27  			}
    28  		}
    29  	}
    30  	return nil
    31  }
    32  func (this *ChaincodeOwner) Validate() error {
    33  	if this.ExpiresAt != nil {
    34  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ExpiresAt); err != nil {
    35  			return github_com_mwitkow_go_proto_validators.FieldError("ExpiresAt", err)
    36  		}
    37  	}
    38  	if this.UpdatedAt != nil {
    39  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.UpdatedAt); err != nil {
    40  			return github_com_mwitkow_go_proto_validators.FieldError("UpdatedAt", err)
    41  		}
    42  	}
    43  	return nil
    44  }
    45  func (this *CreateOwnerRequest) Validate() error {
    46  	if this.MspId == "" {
    47  		return github_com_mwitkow_go_proto_validators.FieldError("MspId", fmt.Errorf(`value '%v' must not be an empty string`, this.MspId))
    48  	}
    49  	if !(len(this.Cert) > 0) {
    50  		return github_com_mwitkow_go_proto_validators.FieldError("Cert", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Cert))
    51  	}
    52  	return nil
    53  }
    54  func (this *UpdateOwnerRequest) Validate() error {
    55  	if this.MspId == "" {
    56  		return github_com_mwitkow_go_proto_validators.FieldError("MspId", fmt.Errorf(`value '%v' must not be an empty string`, this.MspId))
    57  	}
    58  	if !(len(this.Cert) > 0) {
    59  		return github_com_mwitkow_go_proto_validators.FieldError("Cert", fmt.Errorf(`value '%v' must have a length greater than '0'`, this.Cert))
    60  	}
    61  	return nil
    62  }
    63  func (this *OwnerId) Validate() error {
    64  	if this.MspId == "" {
    65  		return github_com_mwitkow_go_proto_validators.FieldError("MspId", fmt.Errorf(`value '%v' must not be an empty string`, this.MspId))
    66  	}
    67  	if this.Subject == "" {
    68  		return github_com_mwitkow_go_proto_validators.FieldError("Subject", fmt.Errorf(`value '%v' must not be an empty string`, this.Subject))
    69  	}
    70  	return nil
    71  }
    72  func (this *ChaincodeOwnerCreated) Validate() error {
    73  	if this.ExpiresAt != nil {
    74  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ExpiresAt); err != nil {
    75  			return github_com_mwitkow_go_proto_validators.FieldError("ExpiresAt", err)
    76  		}
    77  	}
    78  	return nil
    79  }
    80  func (this *ChaincodeOwnerUpdated) Validate() error {
    81  	if this.ExpiresAt != nil {
    82  		if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ExpiresAt); err != nil {
    83  			return github_com_mwitkow_go_proto_validators.FieldError("ExpiresAt", err)
    84  		}
    85  	}
    86  	return nil
    87  }
    88  func (this *ChaincodeOwnerDeleted) Validate() error {
    89  	return nil
    90  }