github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1/tpm_attestation_cert/tpm_attestation_cert_change.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/devices/proto/v1/tpm_attestation_cert_change.proto 3 // DO NOT EDIT!!! 4 5 package tpm_attestation_cert 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 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project" 24 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 25 ) 26 27 var ( 28 _ = bytes.Equal 29 _ = errors.New 30 _ = fmt.Errorf 31 _ = net.ParseIP 32 _ = regexp.Match 33 _ = strings.Split 34 _ = time.Now 35 _ = utf8.RuneCountInString 36 _ = url.Parse 37 _ = gotenvalidate.NewValidationError 38 ) 39 40 // make sure we're using proto imports 41 var ( 42 _ = &project.Project{} 43 _ = &fieldmaskpb.FieldMask{} 44 ) 45 46 func (obj *TpmAttestationCertChange) GotenValidate() error { 47 if obj == nil { 48 return nil 49 } 50 switch opt := obj.ChangeType.(type) { 51 case *TpmAttestationCertChange_Added_: 52 if subobj, ok := interface{}(opt.Added).(gotenvalidate.Validator); ok { 53 if err := subobj.GotenValidate(); err != nil { 54 return gotenvalidate.NewValidationError("TpmAttestationCertChange", "added", opt.Added, "nested object validation failed", err) 55 } 56 } 57 case *TpmAttestationCertChange_Modified_: 58 if subobj, ok := interface{}(opt.Modified).(gotenvalidate.Validator); ok { 59 if err := subobj.GotenValidate(); err != nil { 60 return gotenvalidate.NewValidationError("TpmAttestationCertChange", "modified", opt.Modified, "nested object validation failed", err) 61 } 62 } 63 case *TpmAttestationCertChange_Current_: 64 if subobj, ok := interface{}(opt.Current).(gotenvalidate.Validator); ok { 65 if err := subobj.GotenValidate(); err != nil { 66 return gotenvalidate.NewValidationError("TpmAttestationCertChange", "current", opt.Current, "nested object validation failed", err) 67 } 68 } 69 case *TpmAttestationCertChange_Removed_: 70 if subobj, ok := interface{}(opt.Removed).(gotenvalidate.Validator); ok { 71 if err := subobj.GotenValidate(); err != nil { 72 return gotenvalidate.NewValidationError("TpmAttestationCertChange", "removed", opt.Removed, "nested object validation failed", err) 73 } 74 } 75 default: 76 _ = opt 77 } 78 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 79 return cvobj.GotenCustomValidate() 80 } 81 return nil 82 } 83 func (obj *TpmAttestationCertChange_Added) GotenValidate() error { 84 if obj == nil { 85 return nil 86 } 87 if subobj, ok := interface{}(obj.TpmAttestationCert).(gotenvalidate.Validator); ok { 88 if err := subobj.GotenValidate(); err != nil { 89 return gotenvalidate.NewValidationError("Added", "tpmAttestationCert", obj.TpmAttestationCert, "nested object validation failed", err) 90 } 91 } 92 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 93 return cvobj.GotenCustomValidate() 94 } 95 return nil 96 } 97 func (obj *TpmAttestationCertChange_Modified) GotenValidate() error { 98 if obj == nil { 99 return nil 100 } 101 if subobj, ok := interface{}(obj.TpmAttestationCert).(gotenvalidate.Validator); ok { 102 if err := subobj.GotenValidate(); err != nil { 103 return gotenvalidate.NewValidationError("Modified", "tpmAttestationCert", obj.TpmAttestationCert, "nested object validation failed", err) 104 } 105 } 106 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 107 return cvobj.GotenCustomValidate() 108 } 109 return nil 110 } 111 func (obj *TpmAttestationCertChange_Current) GotenValidate() error { 112 if obj == nil { 113 return nil 114 } 115 if subobj, ok := interface{}(obj.TpmAttestationCert).(gotenvalidate.Validator); ok { 116 if err := subobj.GotenValidate(); err != nil { 117 return gotenvalidate.NewValidationError("Current", "tpmAttestationCert", obj.TpmAttestationCert, "nested object validation failed", err) 118 } 119 } 120 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 121 return cvobj.GotenCustomValidate() 122 } 123 return nil 124 } 125 func (obj *TpmAttestationCertChange_Removed) GotenValidate() error { 126 if obj == nil { 127 return nil 128 } 129 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 130 return cvobj.GotenCustomValidate() 131 } 132 return nil 133 }