github.com/cloudwan/edgelq-sdk@v1.15.4/iam/resources/v1/service_account_key/service_account_key.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/iam/proto/v1/service_account_key.proto 3 // DO NOT EDIT!!! 4 5 package service_account_key 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 service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account" 24 meta "github.com/cloudwan/goten-sdk/types/meta" 25 timestamppb "google.golang.org/protobuf/types/known/timestamppb" 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 _ = &service_account.ServiceAccount{} 44 _ = ×tamppb.Timestamp{} 45 _ = &meta.Meta{} 46 ) 47 48 func (obj *ServiceAccountKey) GotenValidate() error { 49 if obj == nil { 50 return nil 51 } 52 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 53 if err := subobj.GotenValidate(); err != nil { 54 return gotenvalidate.NewValidationError("ServiceAccountKey", "metadata", obj.Metadata, "nested object validation failed", err) 55 } 56 } 57 { 58 rlen := utf8.RuneCountInString(obj.DisplayName) 59 if rlen > 256 { 60 return gotenvalidate.NewValidationError("ServiceAccountKey", "displayName", obj.DisplayName, "field must contain at most 256 characters", nil) 61 } 62 } 63 { 64 rlen := utf8.RuneCountInString(obj.Description) 65 if rlen > 256 { 66 return gotenvalidate.NewValidationError("ServiceAccountKey", "description", obj.Description, "field must contain at most 256 characters", nil) 67 } 68 } 69 if _, ok := ServiceAccountKey_Algorithm_name[int32(obj.Algorithm)]; !ok { 70 return gotenvalidate.NewValidationError("ServiceAccountKey", "algorithm", obj.Algorithm, "field must be a defined enum value", nil) 71 } 72 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 73 return cvobj.GotenCustomValidate() 74 } 75 return nil 76 }