github.com/cloudwan/edgelq-sdk@v1.15.4/iam/client/v1alpha2/attestation/attestation_custom.pb.validate.go (about)

     1  // Code generated by protoc-gen-goten-validate
     2  // File: edgelq/iam/proto/v1alpha2/attestation_custom.proto
     3  // DO NOT EDIT!!!
     4  
     5  package attestation_client
     6  
     7  import (
     8  	"bytes"
     9  	"errors"
    10  	"fmt"
    11  	"net"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	gotenvalidate "github.com/cloudwan/goten-sdk/runtime/validate"
    19  )
    20  
    21  // proto imports
    22  import (
    23  	attestation_domain "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/attestation_domain"
    24  	iam_common "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/common"
    25  	project "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/project"
    26  )
    27  
    28  var (
    29  	_ = bytes.Equal
    30  	_ = errors.New
    31  	_ = fmt.Errorf
    32  	_ = net.ParseIP
    33  	_ = regexp.Match
    34  	_ = strings.Split
    35  	_ = time.Now
    36  	_ = utf8.RuneCountInString
    37  	_ = url.Parse
    38  	_ = gotenvalidate.NewValidationError
    39  )
    40  
    41  // make sure we're using proto imports
    42  var (
    43  	_ = &attestation_domain.AttestationDomain{}
    44  	_ = &iam_common.PCR{}
    45  	_ = &project.Project{}
    46  )
    47  
    48  func (obj *VerifyRequest) GotenValidate() error {
    49  	if obj == nil {
    50  		return nil
    51  	}
    52  	switch opt := obj.Msg.(type) {
    53  	case *VerifyRequest_AskForChallenge_:
    54  		if subobj, ok := interface{}(opt.AskForChallenge).(gotenvalidate.Validator); ok {
    55  			if err := subobj.GotenValidate(); err != nil {
    56  				return gotenvalidate.NewValidationError("VerifyRequest", "askForChallenge", opt.AskForChallenge, "nested object validation failed", err)
    57  			}
    58  		}
    59  	case *VerifyRequest_ChallengeResponse_:
    60  		if subobj, ok := interface{}(opt.ChallengeResponse).(gotenvalidate.Validator); ok {
    61  			if err := subobj.GotenValidate(); err != nil {
    62  				return gotenvalidate.NewValidationError("VerifyRequest", "challengeResponse", opt.ChallengeResponse, "nested object validation failed", err)
    63  			}
    64  		}
    65  	default:
    66  		_ = opt
    67  	}
    68  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    69  		return cvobj.GotenCustomValidate()
    70  	}
    71  	return nil
    72  }
    73  func (obj *VerifyRequest_AskForChallenge) GotenValidate() error {
    74  	if obj == nil {
    75  		return nil
    76  	}
    77  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
    78  		return cvobj.GotenCustomValidate()
    79  	}
    80  	return nil
    81  }
    82  func (obj *VerifyRequest_ChallengeResponse) GotenValidate() error {
    83  	if obj == nil {
    84  		return nil
    85  	}
    86  	for idx, elem := range obj.Quotes {
    87  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    88  			if err := subobj.GotenValidate(); err != nil {
    89  				return gotenvalidate.NewValidationError("ChallengeResponse", "quotes", obj.Quotes[idx], "nested object validation failed", err)
    90  			}
    91  		}
    92  	}
    93  	for idx, elem := range obj.Pcrs {
    94  		if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok {
    95  			if err := subobj.GotenValidate(); err != nil {
    96  				return gotenvalidate.NewValidationError("ChallengeResponse", "pcrs", obj.Pcrs[idx], "nested object validation failed", err)
    97  			}
    98  		}
    99  	}
   100  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   101  		return cvobj.GotenCustomValidate()
   102  	}
   103  	return nil
   104  }
   105  func (obj *VerifyRequest_ChallengeResponse_Quote) GotenValidate() error {
   106  	if obj == nil {
   107  		return nil
   108  	}
   109  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   110  		return cvobj.GotenCustomValidate()
   111  	}
   112  	return nil
   113  }
   114  func (obj *VerifyResponse) GotenValidate() error {
   115  	if obj == nil {
   116  		return nil
   117  	}
   118  	switch opt := obj.Msg.(type) {
   119  	case *VerifyResponse_Challenge_:
   120  		if subobj, ok := interface{}(opt.Challenge).(gotenvalidate.Validator); ok {
   121  			if err := subobj.GotenValidate(); err != nil {
   122  				return gotenvalidate.NewValidationError("VerifyResponse", "challenge", opt.Challenge, "nested object validation failed", err)
   123  			}
   124  		}
   125  	case *VerifyResponse_AttestationSuccessful_:
   126  		if subobj, ok := interface{}(opt.AttestationSuccessful).(gotenvalidate.Validator); ok {
   127  			if err := subobj.GotenValidate(); err != nil {
   128  				return gotenvalidate.NewValidationError("VerifyResponse", "attestationSuccessful", opt.AttestationSuccessful, "nested object validation failed", err)
   129  			}
   130  		}
   131  	default:
   132  		_ = opt
   133  	}
   134  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   135  		return cvobj.GotenCustomValidate()
   136  	}
   137  	return nil
   138  }
   139  func (obj *VerifyResponse_Challenge) GotenValidate() error {
   140  	if obj == nil {
   141  		return nil
   142  	}
   143  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   144  		return cvobj.GotenCustomValidate()
   145  	}
   146  	return nil
   147  }
   148  func (obj *VerifyResponse_AttestationSuccessful) GotenValidate() error {
   149  	if obj == nil {
   150  		return nil
   151  	}
   152  	if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok {
   153  		return cvobj.GotenCustomValidate()
   154  	}
   155  	return nil
   156  }