github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1/os_image_profile/os_image_profile.pb.validate.go (about) 1 // Code generated by protoc-gen-goten-validate 2 // File: edgelq/devices/proto/v1/os_image_profile.proto 3 // DO NOT EDIT!!! 4 5 package os_image_profile 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 device_type "github.com/cloudwan/edgelq-sdk/devices/resources/v1/device_type" 24 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project" 25 meta "github.com/cloudwan/goten-sdk/types/meta" 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 _ = &device_type.DeviceType{} 44 _ = &project.Project{} 45 _ = &meta.Meta{} 46 ) 47 48 func (obj *OsImageProfile) 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("OsImageProfile", "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("OsImageProfile", "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("OsImageProfile", "description", obj.Description, "field must contain at most 256 characters", nil) 67 } 68 } 69 if cvobj, ok := interface{}(obj).(gotenvalidate.CustomValidator); ok { 70 return cvobj.GotenCustomValidate() 71 } 72 return nil 73 }