github.com/cloudwan/edgelq-sdk@v1.15.4/limits/resources/v1/plan/plan.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/limits/proto/v1/plan.proto 3 // DO NOT EDIT!!! 4 5 package plan 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 iam_iam_common "github.com/cloudwan/edgelq-sdk/iam/resources/v1/common" 24 iam_organization "github.com/cloudwan/edgelq-sdk/iam/resources/v1/organization" 25 meta_resource "github.com/cloudwan/goten-sdk/meta-service/resources/v1/resource" 26 meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service" 27 meta "github.com/cloudwan/goten-sdk/types/meta" 28 ) 29 30 var ( 31 _ = bytes.Equal 32 _ = errors.New 33 _ = fmt.Errorf 34 _ = net.ParseIP 35 _ = regexp.Match 36 _ = strings.Split 37 _ = time.Now 38 _ = utf8.RuneCountInString 39 _ = url.Parse 40 _ = gotenvalidate.NewValidationError 41 ) 42 43 // make sure we're using proto imports 44 var ( 45 _ = &iam_iam_common.PCR{} 46 _ = &iam_organization.Organization{} 47 _ = &meta_resource.Resource{} 48 _ = &meta_service.Service{} 49 _ = &meta.Meta{} 50 ) 51 52 func (obj *Plan) GotenValidate() error { 53 if obj == nil { 54 return nil 55 } 56 if subobj, ok := interface{}(obj.Metadata).(gotenvalidate.Validator); ok { 57 if err := subobj.GotenValidate(); err != nil { 58 return gotenvalidate.NewValidationError("Plan", "metadata", obj.Metadata, "nested object validation failed", err) 59 } 60 } 61 { 62 rlen := utf8.RuneCountInString(obj.DisplayName) 63 if rlen > 256 { 64 return gotenvalidate.NewValidationError("Plan", "displayName", obj.DisplayName, "field must contain at most 256 characters", nil) 65 } 66 } 67 for idx, elem := range obj.ResourceLimits { 68 if subobj, ok := interface{}(elem).(gotenvalidate.Validator); ok { 69 if err := subobj.GotenValidate(); err != nil { 70 return gotenvalidate.NewValidationError("Plan", "resourceLimits", obj.ResourceLimits[idx], "nested object validation failed", err) 71 } 72 } 73 } 74 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 75 return cvobj.GotenCustomValidate() 76 } 77 return nil 78 } 79 func (obj *Plan_LimitValue) GotenValidate() error { 80 if obj == nil { 81 return nil 82 } 83 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 84 return cvobj.GotenCustomValidate() 85 } 86 return nil 87 }