github.com/cloudwan/edgelq-sdk@v1.15.4/common/api/credentials.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/common/api/credentials.proto 3 // DO NOT EDIT!!! 4 5 package api 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 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 24 ) 25 26 var ( 27 _ = bytes.Equal 28 _ = errors.New 29 _ = fmt.Errorf 30 _ = net.ParseIP 31 _ = regexp.Match 32 _ = strings.Split 33 _ = time.Now 34 _ = utf8.RuneCountInString 35 _ = url.Parse 36 _ = gotenvalidate.NewValidationError 37 ) 38 39 // make sure we're using proto imports 40 var ( 41 _ = ×tamppb.Timestamp{} 42 ) 43 44 func (obj *Account) GotenValidate() error { 45 if obj == nil { 46 return nil 47 } 48 switch opt := obj.Account.(type) { 49 case *Account_User: 50 if subobj, ok := interface{}(opt.User).(gotenvalidate.Validator); ok { 51 if err := subobj.GotenValidate(); err != nil { 52 return gotenvalidate.NewValidationError("Account", "user", opt.User, "nested object validation failed", err) 53 } 54 } 55 case *Account_ServiceAccount: 56 if subobj, ok := interface{}(opt.ServiceAccount).(gotenvalidate.Validator); ok { 57 if err := subobj.GotenValidate(); err != nil { 58 return gotenvalidate.NewValidationError("Account", "serviceAccount", opt.ServiceAccount, "nested object validation failed", err) 59 } 60 } 61 default: 62 _ = opt 63 } 64 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 65 return cvobj.GotenCustomValidate() 66 } 67 return nil 68 } 69 func (obj *User) GotenValidate() error { 70 if obj == nil { 71 return nil 72 } 73 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 74 return cvobj.GotenCustomValidate() 75 } 76 return nil 77 } 78 func (obj *ServiceAccount) GotenValidate() error { 79 if obj == nil { 80 return nil 81 } 82 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 83 return cvobj.GotenCustomValidate() 84 } 85 return nil 86 }