github.com/cloudwan/edgelq-sdk@v1.15.4/iam/resources/v1/user/user.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/iam/proto/v1/user.proto 3 // DO NOT EDIT!!! 4 5 package user 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 meta "github.com/cloudwan/goten-sdk/types/meta" 24 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 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 _ = ×tamppb.Timestamp{} 43 _ = &meta.Meta{} 44 ) 45 46 func (obj *User) GotenValidate() error { 47 if obj == nil { 48 return nil 49 } 50 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 51 if err := subobj.GotenValidate(); err != nil { 52 return gotenvalidate.NewValidationError("User", "metadata", obj.Metadata, "nested object validation failed", err) 53 } 54 } 55 if err := gotenvalidate.ValidateEmail(string(obj.Email)); err != nil { 56 return gotenvalidate.NewValidationError("User", "email", obj.Email, "field must contain a valid email address", err) 57 } 58 if subobj, ok := interface{}(obj.AuthInfo).(gotenvalidate.Validator); ok { 59 if err := subobj.GotenValidate(); err != nil { 60 return gotenvalidate.NewValidationError("User", "authInfo", obj.AuthInfo, "nested object validation failed", err) 61 } 62 } 63 if subobj, ok := interface{}(obj.CtrlStatus).(gotenvalidate.Validator); ok { 64 if err := subobj.GotenValidate(); err != nil { 65 return gotenvalidate.NewValidationError("User", "ctrlStatus", obj.CtrlStatus, "nested object validation failed", err) 66 } 67 } 68 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 69 return cvobj.GotenCustomValidate() 70 } 71 return nil 72 } 73 func (obj *User_AuthInfo) 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 *User_WorkStatus) GotenValidate() error { 83 if obj == nil { 84 return nil 85 } 86 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 87 return cvobj.GotenCustomValidate() 88 } 89 return nil 90 }